Date: Thu, 31 Dec 2009 18:52:58 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r201347 - head/sys/kern Message-ID: <200912311852.nBVIqxrV078985@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912311852.nBVIqxrV078985>