From owner-cvs-src-old@FreeBSD.ORG Mon Jan 18 14:48:17 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C0531065694 for ; Mon, 18 Jan 2010 14:48:17 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 885628FC1C for ; Mon, 18 Jan 2010 14:48:17 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o0IEmHev071480 for ; Mon, 18 Jan 2010 14:48:17 GMT (envelope-from attilio@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o0IEmHRY071479 for cvs-src-old@freebsd.org; Mon, 18 Jan 2010 14:48:17 GMT (envelope-from attilio@repoman.freebsd.org) Message-Id: <201001181448.o0IEmHRY071479@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to attilio@repoman.freebsd.org using -f From: Attilio Rao Date: Mon, 18 Jan 2010 14:43:44 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_8 Subject: cvs commit: src/share/man/man9 sleepqueue.9 src/sys/kern kern_lock.c kern_sx.c subr_sleepqueue.c src/sys/sys lockmgr.h sleepqueue.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 14:48:17 -0000 attilio 2010-01-18 14:43:44 UTC FreeBSD src repository Modified files: (Branch: RELENG_8) share/man/man9 sleepqueue.9 sys/kern kern_lock.c kern_sx.c subr_sleepqueue.c sys/sys lockmgr.h sleepqueue.h Log: SVN rev 202576 on 2010-01-18 14:43:44Z by attilio MFC r200447,201703,201709-201710: In current code, threads performing an interruptible sleep will leave the waiters flag on forcing the owner to do a wakeup even when the waiter queue is empty. That operation may lead to a deadlock in the case of doing a fake wakeup on the "preferred" queue while the other queue has real waiters on it, because nobody is going to wakeup the 2nd queue waiters and they will sleep indefinitively. A similar bug, is present, for lockmgr in the case the waiters are sleeping with LK_SLEEPFAIL on. Add a sleepqueue interface which does report the actual number of waiters on a specified queue of a waitchannel and track if at least one sleepfail waiter is present or not. In presence of this or empty "preferred" queue, wakeup both waiters queues. Discussed with: kib Tested by: Pete French , Justin Head Revision Changes Path 1.17.2.3 +12 -1 src/share/man/man9/sleepqueue.9 1.144.2.7 +142 -15 src/sys/kern/kern_lock.c 1.67.2.7 +5 -1 src/sys/kern/kern_sx.c 1.64.2.2 +31 -4 src/sys/kern/subr_sleepqueue.c 1.72.2.2 +3 -0 src/sys/sys/lockmgr.h 1.17.2.2 +1 -0 src/sys/sys/sleepqueue.h