From owner-svn-src-all@FreeBSD.ORG Mon Oct 20 19:22:16 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D179106566B; Mon, 20 Oct 2008 19:22:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B5B88FC18; Mon, 20 Oct 2008 19:22:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KJMG0r079018; Mon, 20 Oct 2008 19:22:16 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KJMGnr079017; Mon, 20 Oct 2008 19:22:16 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200810201922.m9KJMGnr079017@svn.freebsd.org> From: Attilio Rao Date: Mon, 20 Oct 2008 19:22:16 +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: r184098 - 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: Mon, 20 Oct 2008 19:22:16 -0000 Author: attilio Date: Mon Oct 20 19:22:16 2008 New Revision: 184098 URL: http://svn.freebsd.org/changeset/base/184098 Log: In the actual code for witness_warn: - If there aren't spinlocks held, but there are problems with old sleeplocks, they are not reported. - If the spinlock found is not the only one, problems are not reported. Fix these 2 problems. Reported by: tegge Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Mon Oct 20 18:56:00 2008 (r184097) +++ head/sys/kern/subr_witness.c Mon Oct 20 19:22:16 2008 (r184098) @@ -1628,13 +1628,7 @@ witness_warn(int flags, struct lock_obje */ sched_pin(); lock_list = PCPU_GET(spinlocks); - if (lock_list != NULL) { - - /* Empty list? */ - if (lock_list->ll_count == 0) { - sched_unpin(); - return (n); - } + if (lock_list != NULL && lock_list->ll_count != 0) { sched_unpin(); /* @@ -1644,18 +1638,17 @@ witness_warn(int flags, struct lock_obje * should hold. */ lock1 = &lock_list->ll_children[lock_list->ll_count - 1]; - if (lock1->li_lock == lock) - return (n); - - if (n == 0) { - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - printf(" with the following"); - if (flags & WARN_SLEEPOK) - printf(" non-sleepable"); - printf(" locks held:\n"); - } + if (lock_list->ll_count == 1 && lock_list->ll_next == NULL && + lock1->li_lock == lock && n == 0) + return (0); + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf(" with the following"); + if (flags & WARN_SLEEPOK) + printf(" non-sleepable"); + printf(" locks held:\n"); n += witness_list_locks(&lock_list); } else sched_unpin();