From owner-cvs-src@FreeBSD.ORG Fri Aug 31 19:01:31 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8204C16A41A; Fri, 31 Aug 2007 19:01:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4C813C45E; Fri, 31 Aug 2007 19:01:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l7VJ1Vdm077706; Fri, 31 Aug 2007 19:01:31 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l7VJ1VUx077705; Fri, 31 Aug 2007 19:01:31 GMT (envelope-from jhb) Message-Id: <200708311901.l7VJ1VUx077705@repoman.freebsd.org> From: John Baldwin Date: Fri, 31 Aug 2007 19:01:30 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern kern_timeout.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2007 19:01:31 -0000 jhb 2007-08-31 19:01:30 UTC FreeBSD src repository Modified files: sys/kern kern_timeout.c Log: Close a race that snuck in with the recent changes to fix a LOR between the callout_lock spin lock and the sleepqueue spin locks. In the fix, callout_drain() has to drop the callout_lock so it can acquire the sleepqueue lock. The state of the callout can change while the callout_lock is held however (for example, it can be rescheduled via callout_reset()). The previous code assumed that the only state change that could happen is that the callout could finish executing. This change alters callout_drain() to effectively restart and recheck everything after it acquires the sleepqueue lock thus handling all the possible states that the callout could be in after any changes while callout_lock was dropped. Approved by: re (kensmith) Tested by: kris Revision Changes Path 1.105 +27 -13 src/sys/kern/kern_timeout.c