Preventing deadlocks on the event queue.

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed Feb 4 05:38:12 PST 2004


On Mon, Jan 26, 2004 at 05:15:37PM +0100, Poul-Henning Kamp wrote:
+> >+> > 	http://garage.freebsd.pl/patches/geom_event_deadlock.patch
+> >+>=20
+> >+> Do you really want to make this a separate function?  Since it's just a
+> >+> one-line comparison, wouldn't a macro suffice?
+> >
+> >I want to avoid exporting 'g_event_proc' from geom_kern.c (it is declareted
+> >staticaly there).
+> 
+> Right, g_event_proc should stay local to geom_kern.c if at all possible.
+> 
+> I'm still trying to see if I can find a more elegant way to do it, but
+> curproc/curthread is probably the trick.

I think this is more elegant way:

	http://garage.freebsd.pl/patches/geom_event_deadlock.2.patch

It will not be needed if we uncomment g_topology_assert_not(),
but my previous patch will protect even from something like this:

	g_topology_unlock();
	sx_xunlock(&g_eventstall);
	g_waitfor_event();
	sx_xlock(&g_eventstall);
	g_topology_lock();
:)

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd at FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20040204/e1558b7e/attachment-0001.bin


More information about the freebsd-geom mailing list