From owner-freebsd-arch@FreeBSD.ORG Thu Nov 20 00:38:36 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE4F61065670 for ; Thu, 20 Nov 2008 00:38:36 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from outbound.icp-qv1-irony-out4.iinet.net.au (outbound.icp-qv1-irony-out4.iinet.net.au [203.59.1.150]) by mx1.freebsd.org (Postfix) with ESMTP id 52B6F8FC13 for ; Thu, 20 Nov 2008 00:38:36 +0000 (UTC) (envelope-from lstewart@freebsd.org) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALBAJEl8qEpL/2dsb2JhbADTD4ItTA X-IronPort-AV: E=Sophos;i="4.33,636,1220198400"; d="scan'208";a="278628727" Received: from unknown (HELO lawrence1.loshell.room52.net) ([124.168.74.75]) by outbound.icp-qv1-irony-out4.iinet.net.au with ESMTP; 20 Nov 2008 09:38:34 +0900 Message-ID: <4924B18A.4060100@freebsd.org> Date: Thu, 20 Nov 2008 11:38:34 +1100 From: Lawrence Stewart User-Agent: Thunderbird 2.0.0.17 (X11/20081109) MIME-Version: 1.0 To: Julian Elischer References: <492412E8.3060700@freebsd.org> <49245D3B.8050607@elischer.org> <49248958.9060308@freebsd.org> <49249624.7020108@elischer.org> <4924A6BE.8080308@freebsd.org> In-Reply-To: <4924A6BE.8080308@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org Subject: Re: kthread_exit(9) unexpectedness X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2008 00:38:36 -0000 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