From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ebiederm.dsl.xmission.com (ebiederm.dsl.xmission.com [166.70.28.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 661E4DDEF5 for ; Tue, 24 Apr 2007 13:22:14 +1000 (EST) From: ebiederm@xmission.com (Eric W. Biederman) To: Benjamin Herrenschmidt Subject: Re: [PATCH] powerpc pseries eeh: Convert to kthread API References: <11769695763104-git-send-email-ebiederm@xmission.com> <20070422123155.GF20763@infradead.org> <20070423205020.GR31947@austin.ibm.com> <1177378733.14873.52.camel@localhost.localdomain> <1177382544.14873.57.camel@localhost.localdomain> Date: Mon, 23 Apr 2007 21:20:37 -0600 In-Reply-To: <1177382544.14873.57.camel@localhost.localdomain> (Benjamin Herrenschmidt's message of "Tue, 24 Apr 2007 12:42:24 +1000") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: ", linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , linuxppc-dev@ozlabs.org, Paul Mackerras , containers@lists.osdl.org, Oleg Nesterov List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Benjamin Herrenschmidt writes: > Not sure... I can see places where I might want to spawn an arbitrary > number of these without having to preallocate structures... and if I > allocate on the fly, then I need a way to free that structure when the > kthread is reaped which I don't think we have currently, do we ? (In > fact, I could use that for other things too now that I'm thinking of > it ... I might have a go at providing optional kthread destructors). Well the basic problem is that for any piece of code that can be modular we need a way to ensure all threads it has running are shutdown when we remove the module. Which means a fire and forget model however simple is unfortunately the wrong thing. Now we might be able to wrap this in some kind of manager construct, so you don't have to manage each thread individually, but we still have the problem of ensuring all of the threads exit when we terminate the module. Further in general it doesn't make sense to grab a module reference and call that sufficient because we would like to request that the module exits. Eric