Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263564AbUJ2VEx (ORCPT ); Fri, 29 Oct 2004 17:04:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263504AbUJ2VEc (ORCPT ); Fri, 29 Oct 2004 17:04:32 -0400 Received: from fw.osdl.org ([65.172.181.6]:17851 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S263573AbUJ2VDY (ORCPT ); Fri, 29 Oct 2004 17:03:24 -0400 Date: Fri, 29 Oct 2004 14:03:19 -0700 (PDT) From: Linus Torvalds To: linux-os@analogic.com cc: Kernel Mailing List , Richard Henderson , Andi Kleen , Andrew Morton , Jan Hubicka Subject: Re: Semaphore assembly-code bug In-Reply-To: Message-ID: References: <417550FB.8020404@drdos.com> <1098218286.8675.82.camel@mentorng.gurulabs.com> <41757478.4090402@drdos.com> <20041020034524.GD10638@michonline.com> <1098245904.23628.84.camel@krustophenia.net> <1098247307.23628.91.camel@krustophenia.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1194 Lines: 28 On Fri, 29 Oct 2004, Linus Torvalds wrote: > > Here's a totally untested patch to make the semaphores use "fastcall" > instead of "asmlinkage" Ok, I tested it, looked through the assembly code, and did a general size comparison. Everything looks good, and it should fix the problem that caused this discussion. Checked in. The patch actually improves code generation by moving the failure case argument generation _into_ the failure case: this makes the inline asm one instruction longer, but it means that the fastpath is often one instruction shorter. In fact, the fastpath is usually improved even _more_ than that, because gcc does sucketh at generating code that uses fixed registers (ie the old code often caused gcc to first generate the value into another register, and then _move_ it into %eax, rather than just generating it into %eax in the first place). My test-kernel shrunk by a whopping 2kB in size from this change. Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/