1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

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 Rao 2012-12-21 13:14:12 +00:00
parent 936c747be0
commit b1308d72c2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244534
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 @@ vlrureclaim(struct mount *mp)
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);
}