From owner-svn-src-head@FreeBSD.ORG Thu Dec 31 18:52:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 339AF106566B; Thu, 31 Dec 2009 18:52:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 210E58FC15; Thu, 31 Dec 2009 18:52:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVIqxSs078988; Thu, 31 Dec 2009 18:52:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVIqxrV078985; Thu, 31 Dec 2009 18:52:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912311852.nBVIqxrV078985@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Dec 2009 18:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201347 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 18:52:59 -0000 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);