From owner-svn-src-all@FreeBSD.ORG Wed Aug 22 20:01:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 961A81065687; Wed, 22 Aug 2012 20:01:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81E7E8FC1B; Wed, 22 Aug 2012 20:01:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MK1dNa089239; Wed, 22 Aug 2012 20:01:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK1dBu089235; Wed, 22 Aug 2012 20:01:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208222001.q7MK1dBu089235@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 20:01:39 +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: r239585 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 20:01:39 -0000 Author: jhb Date: Wed Aug 22 20:01:38 2012 New Revision: 239585 URL: http://svn.freebsd.org/changeset/base/239585 Log: Mark the idle threads as non-sleepable and also assert that an idle thread never blocks on a turnstile. Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_turnstile.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Wed Aug 22 20:00:41 2012 (r239584) +++ head/sys/kern/sched_4bsd.c Wed Aug 22 20:01:38 2012 (r239585) @@ -1598,6 +1598,7 @@ sched_idletd(void *dummy) { struct pcpuidlestat *stat; + THREAD_NO_SLEEPING(); stat = DPCPU_PTR(idlestat); for (;;) { mtx_assert(&Giant, MA_NOTOWNED); Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Aug 22 20:00:41 2012 (r239584) +++ head/sys/kern/sched_ule.c Wed Aug 22 20:01:38 2012 (r239585) @@ -2581,6 +2581,7 @@ sched_idletd(void *dummy) mtx_assert(&Giant, MA_NOTOWNED); td = curthread; tdq = TDQ_SELF(); + THREAD_NO_SLEEPING(); for (;;) { #ifdef SMP if (tdq_idled(tdq) == 0) Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Wed Aug 22 20:00:41 2012 (r239584) +++ head/sys/kern/subr_turnstile.c Wed Aug 22 20:01:38 2012 (r239585) @@ -684,6 +684,7 @@ turnstile_wait(struct turnstile *ts, str if (owner) MPASS(owner->td_proc->p_magic == P_MAGIC); MPASS(queue == TS_SHARED_QUEUE || queue == TS_EXCLUSIVE_QUEUE); + KASSERT(!TD_IS_IDLETHREAD(td), ("idle threads cannot block on locks")); /* * If the lock does not already have a turnstile, use this thread's