Fixup r218424: uio_yield() was scaling directly to userland priority.

When kern_yield() was introduced with the possibility to specify
a new priority, the behaviour changed by not lowering priority at all
in the consumers, making the yielding mechanism highly ineffective for
high priority kthreads like bufdaemon, syncer, vlrudaemon, etc.
There are no evidences that consumers could bear with such change in
semantic and this situation could finally lead to bugs similar to the
ones fixed in r244240.
Re-specify userland pri for kthreads involved.

Tested by:	pho
Reviewed by:	kib, mdf
MFC after:	1 week
This commit is contained in:
attilio 2012-12-21 13:14:12 +00:00
parent 1292747048
commit 0d14b65c78
4 changed files with 7 additions and 7 deletions

View File

@ -2209,7 +2209,7 @@ buf_daemon()
while (numdirtybuffers > lodirtybuffers) {
if (buf_do_flush(NULL) == 0)
break;
kern_yield(PRI_UNCHANGED);
kern_yield(PRI_USER);
}
lodirtybuffers = lodirtysave;

View File

@ -1724,7 +1724,7 @@ __mnt_vnode_next(struct vnode **mvp, struct mount *mp)
KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch"));
if (should_yield()) {
MNT_IUNLOCK(mp);
kern_yield(PRI_UNCHANGED);
kern_yield(PRI_USER);
MNT_ILOCK(mp);
}
vp = TAILQ_NEXT(*mvp, v_nmntvnodes);

View File

@ -741,7 +741,7 @@ next_iter:
continue;
MNT_IUNLOCK(mp);
yield:
kern_yield(PRI_UNCHANGED);
kern_yield(PRI_USER);
relock_mnt:
MNT_ILOCK(mp);
}
@ -853,7 +853,7 @@ vnlru_proc(void)
vnlru_nowhere++;
tsleep(vnlruproc, PPAUSE, "vlrup", hz * 3);
} else
kern_yield(PRI_UNCHANGED);
kern_yield(PRI_USER);
}
}
@ -4635,7 +4635,7 @@ __mnt_vnode_next_all(struct vnode **mvp, struct mount *mp)
struct vnode *vp;
if (should_yield())
kern_yield(PRI_UNCHANGED);
kern_yield(PRI_USER);
MNT_ILOCK(mp);
KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch"));
vp = TAILQ_NEXT(*mvp, v_nmntvnodes);
@ -4784,7 +4784,7 @@ __mnt_vnode_next_active(struct vnode **mvp, struct mount *mp)
{
if (should_yield())
kern_yield(PRI_UNCHANGED);
kern_yield(PRI_USER);
mtx_lock(&vnode_free_list_mtx);
return (mnt_vnode_next_active(mvp, mp));
}

View File

@ -1569,7 +1569,7 @@ softdep_process_worklist(mp, full)
*/
if (should_yield()) {
FREE_LOCK(&lk);
kern_yield(PRI_UNCHANGED);
kern_yield(PRI_USER);
bwillwrite();
ACQUIRE_LOCK(&lk);
}