From: Christoph Hellwig Subject: Re: [RFC] Add support for semaphore-like structure with support for asynchronous I/O Date: Thu, 7 Apr 2005 12:43:02 +0100 Message-ID: <20050407114302.GA13363@infradead.org> References: <20050330143409.04f48431.akpm@osdl.org> <1112224663.18019.39.camel@lade.trondhjem.org> <1112309586.27458.19.camel@lade.trondhjem.org> <20050331161350.0dc7d376.akpm@osdl.org> <1112318537.11284.10.camel@lade.trondhjem.org> <20050401141225.GA3707@in.ibm.com> <20050404155245.GA4659@in.ibm.com> <20050404162216.GA18469@kvack.org> <1112637395.10602.95.camel@lade.trondhjem.org> <20050405154641.GA27279@kvack.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Trond Myklebust , Suparna Bhattacharya , Andrew Morton , linux-kernel@vger.kernel.org, Linux Filesystem Development , linux-aio@kvack.org Return-path: To: Benjamin LaHaise Content-Disposition: inline In-Reply-To: <20050405154641.GA27279@kvack.org> Sender: owner-linux-aio@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Apr 05, 2005 at 11:46:41AM -0400, Benjamin LaHaise wrote: > On Mon, Apr 04, 2005 at 01:56:35PM -0400, Trond Myklebust wrote: > > IOW: the current semaphore implementations really all need to die, and > > be replaced by a single generic version to which it is actually > > practical to add new functionality. > > I can see that goal, but I don't think introducing iosems is the right > way to acheive it. Instead (and I'll start tackling this), how about > factoring out the existing semaphore implementations to use a common > lib/semaphore.c, much like lib/rwsem.c? The iosems can be used as a > basis for the implementation, but we can avoid having to do a giant > s/semaphore/iosem/g over the kernel tree. Note that iosem is also a total misowner, it's not a counting semaphore but a sleeping mutex with some special features. Now if someone wants my two cent on how to resolve the two gazillion different implementations mess: - switch all current semaphore users that don't need counting semaphores over to use a mutex_t type. For now it can map to struct semaphore. - rip out all existing complicated struct semaphore implementations and replace it with a portable C implementation. There's not a lot of users anyway. Add a mutex_t implementation that allows sensible assembly hooks for architectures instead of reimplementing all of it - add more features to mutex_t where nessecary -- To unsubscribe, send a message with 'unsubscribe linux-aio' in the body to majordomo@kvack.org. For more info on Linux AIO, see: http://www.kvack.org/aio/ Don't email: aart@kvack.org