Date: Mon, 18 Jan 2010 14:43:44 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: cvs-src-old@freebsd.org 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 Message-ID: <201001181448.o0IEmHRY071479@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <petefrench at ticketswitch dot com>,
Justin Head <justin at encarnate dot com>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001181448.o0IEmHRY071479>
