Date: Fri, 31 Aug 2007 19:01:30 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern kern_timeout.c Message-ID: <200708311901.l7VJ1VUx077705@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708311901.l7VJ1VUx077705>