summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-12-31 18:52:58 +0000
committerkib <kib@FreeBSD.org>2009-12-31 18:52:58 +0000
commitfe41ad464e0a52df7e9713310a8ae2bd8a2d4699 (patch)
treefd222c9d9cdc33acaa5f3a227826689d627c984a
parent71291348da8fb112f156fd6f7e0b0e3d44f1f485 (diff)
downloadFreeBSD-src-fe41ad464e0a52df7e9713310a8ae2bd8a2d4699.zip
FreeBSD-src-fe41ad464e0a52df7e9713310a8ae2bd8a2d4699.tar.gz
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
-rw-r--r--sys/kern/sched_4bsd.c2
-rw-r--r--sys/kern/sched_ule.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index e13cffc..c0019a9 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -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;
}
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 1a977a8..43c9a86 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -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);
OpenPOWER on IntegriCloud