svn commit: r201347 - head/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Thu Dec 31 18:52:59 UTC 2009
Author: kib
Date: Thu Dec 31 18:52:58 2009
New Revision: 201347
URL: http://svn.freebsd.org/changeset/base/201347
Log:
Allow swap out of the kernel stack for the thread with priority greater
or equial then PSOCK, not less or equial. Higher priority has lesser
numerical value.
Existing test does not allow for swapout of the thread waiting for
advisory lock, for exiting child or sleeping for timeout. On the other
hand, high-priority waiters of VFS/VM events can be swapped out.
Tested by: pho
Reviewed by: jhb
MFC after: 1 week
Modified:
head/sys/kern/sched_4bsd.c
head/sys/kern/sched_ule.c
Modified: head/sys/kern/sched_4bsd.c
==============================================================================
--- head/sys/kern/sched_4bsd.c Thu Dec 31 18:28:40 2009 (r201346)
+++ head/sys/kern/sched_4bsd.c Thu Dec 31 18:52:58 2009 (r201347)
@@ -913,7 +913,7 @@ sched_sleep(struct thread *td, int pri)
td->td_sched->ts_slptime = 0;
if (pri)
sched_prio(td, pri);
- if (TD_IS_SUSPENDED(td) || pri <= PSOCK)
+ if (TD_IS_SUSPENDED(td) || pri >= PSOCK)
td->td_flags |= TDF_CANSWAP;
}
Modified: head/sys/kern/sched_ule.c
==============================================================================
--- head/sys/kern/sched_ule.c Thu Dec 31 18:28:40 2009 (r201346)
+++ head/sys/kern/sched_ule.c Thu Dec 31 18:52:58 2009 (r201347)
@@ -1909,7 +1909,7 @@ sched_sleep(struct thread *td, int prio)
THREAD_LOCK_ASSERT(td, MA_OWNED);
td->td_slptick = ticks;
- if (TD_IS_SUSPENDED(td) || prio <= PSOCK)
+ if (TD_IS_SUSPENDED(td) || prio >= PSOCK)
td->td_flags |= TDF_CANSWAP;
if (static_boost == 1 && prio)
sched_prio(td, prio);
More information about the svn-src-head
mailing list