Date: Thu, 20 Nov 2008 11:38:34 +1100 From: Lawrence Stewart <lstewart@freebsd.org> To: Julian Elischer <julian@elischer.org> Cc: freebsd-arch@freebsd.org Subject: Re: kthread_exit(9) unexpectedness Message-ID: <4924B18A.4060100@freebsd.org> In-Reply-To: <4924A6BE.8080308@freebsd.org> References: <492412E8.3060700@freebsd.org> <49245D3B.8050607@elischer.org> <49248958.9060308@freebsd.org> <49249624.7020108@elischer.org> <4924A6BE.8080308@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Lawrence Stewart wrote: > Julian Elischer wrote: >> Lawrence Stewart wrote: >> [snip] > >> >>> >>> On the other, we have the 7.x documented behaviour which is correct, >>> but the actual behaviour of the code (which is historically >>> consistent) is incorrect and at odds with the 8.x behaviour. >> >> in 7.x nearly everything uses kproc... so we could probably safely >> change it now. > > We could definitely change it for all in tree cases easily enough. My > concern is out of tree code. This change would make any out of tree code > that relies on the actually implemented wakeup() mechanism potentially > deadlock, which is not nice. We could argue that the documented > behaviour is correct and that we're correcting a bug with the fix... > still, tis cold comfort for anyone who's working code now deadlocks. > > I do like the maintenance simplicity the change would bring moving forward. > > I'm still not sure the code change is the best idea. Does anyone else > have thoughts on the matter? > [snip] *slaps forehead* So, it just occurred to me through my mid-morning mental haze after a chat with attilio@ that we should just call wakeup() on both the *proc _and_ *thread in 7.x and be done with it. It doesn't hurt anyone, maintains the current behaviour, ensures we're living up to our documented KPI of delivering a wakeup on the thread handle and resolves the compatibility issues between 7.x and 8.x in this respect - no potential deadlocks is good++. I'll have a go at a patch for code + man pages shortly. Cheers, Lawrence
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4924B18A.4060100>