bufspace_wait(): only try to help bufdaemon if there is a chance to help
Only call buf_flush() if there are some dirty buffers belonging to the vnode we are allocating the buffer for. Otherwise the bd dirty queue scan cannot find anything and it makes no sense to spend CPU doing it.
This commit is contained in:
+2
-1
@@ -727,7 +727,8 @@ bufspace_wait(struct bufdomain *bd, struct vnode *vp, int gbflags,
|
||||
BD_LOCK(bd);
|
||||
while (bd->bd_wanted) {
|
||||
if (vp != NULL && vp->v_type != VCHR &&
|
||||
(td->td_pflags & TDP_BUFNEED) == 0) {
|
||||
(td->td_pflags & TDP_BUFNEED) == 0 &&
|
||||
vp->v_bufobj.bo_dirty.bv_cnt > 0) {
|
||||
BD_UNLOCK(bd);
|
||||
/*
|
||||
* getblk() is called with a vnode locked, and
|
||||
|
||||
Reference in New Issue
Block a user