From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765715AbYEHSba (ORCPT ); Thu, 8 May 2008 14:31:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756359AbYEHSbR (ORCPT ); Thu, 8 May 2008 14:31:17 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:58960 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755045AbYEHSbQ (ORCPT ); Thu, 8 May 2008 14:31:16 -0400 Date: Thu, 8 May 2008 11:30:38 -0700 (PDT) From: Linus Torvalds To: Ingo Molnar cc: "Zhang, Yanmin" , Andi Kleen , Matthew Wilcox , LKML , Alexander Viro , Andrew Morton , Thomas Gleixner , "H. Peter Anvin" Subject: Re: [patch] speed up / fix the new generic semaphore code (fix AIM7 40% regression with 2.6.26-rc1) In-Reply-To: Message-ID: References: <87lk2mbcqp.fsf@basil.nowhere.org> <20080507114643.GR19219@parisc-linux.org> <87hcdab8zp.fsf@basil.nowhere.org> <1210214696.3453.87.camel@ymzhang> <1210219729.3453.97.camel@ymzhang> <20080508120130.GA2860@elte.hu> <20080508122802.GA4880@elte.hu> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) 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 Thu, 8 May 2008, Linus Torvalds wrote: > > Why don't we just make it do the same thing that the x86 semaphores used > to do: make it signed, and decrement unconditionally. And callt eh > slow-path if it became negative. > ... > and now we have an existing known-good implementation to look at? Ok, after having thought that over, and looked at the code, I think I like your version after all. The old implementation was pretty complex due to the need to be so extra careful about the count that could change outside of the lock, so everything considered, a new implementation that is simpler is probably the better choice. Ergo, I will just pull your scheduler tree. Linus