From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761808AbYDORbU (ORCPT ); Tue, 15 Apr 2008 13:31:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752926AbYDORbH (ORCPT ); Tue, 15 Apr 2008 13:31:07 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:53181 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752852AbYDORbG (ORCPT ); Tue, 15 Apr 2008 13:31:06 -0400 Date: Tue, 15 Apr 2008 10:26:21 -0700 (PDT) From: Linus Torvalds To: Andi Kleen cc: Peter Zijlstra , Bart Van Assche , Roland Dreier , Ingo Molnar , Matthew Wilcox , Ingo Oeser , Daniel Walker , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Replace completions with semaphores In-Reply-To: <4804E29F.9060703@firstfloor.org> Message-ID: References: <20080411210022.GJ11962@parisc-linux.org> <20080413125758.GQ11962@parisc-linux.org> <20080414153928.GA22259@elte.hu> <1208190749.7375.10.camel@twins> <87d4osuy6r.fsf@basil.nowhere.org> <1208195673.7164.2.camel@twins> <4803AD91.5020001@firstfloor.org> <1208242017.7053.4.camel@lappy> <1208249088.7124.7.camel@twins> <4804D779.6070907@firstfloor.org> <4804E29F.9060703@firstfloor.org> User-Agent: Alpine 1.00 (LFD 882 2007-12-20) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Apr 2008, Andi Kleen wrote: > > For normal locks. But if you have N number of outstanding > events you need to wait for the semaphore is the right primitive. Right. Except if you were to just use completions instead (which could be trivially extended to do that). MUCH more trivial than this complex series. (You may think that the "Replace completions with semaphores" patch is not very complicated, but it *is* - it depends very intimately on the big patch-series that basically turns semaphores into what completions are now!) In other words, what makes me not like this is hat we first turn semaphores into the generic code (which is largely what completions were: just a special case of the generic semaphores!) and then turns completions into these things. That just doesn't make any sense to me! Linus