From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750836AbWABQqn (ORCPT ); Mon, 2 Jan 2006 11:46:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750841AbWABQqn (ORCPT ); Mon, 2 Jan 2006 11:46:43 -0500 Received: from cantor2.suse.de ([195.135.220.15]:6113 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S1750836AbWABQqm (ORCPT ); Mon, 2 Jan 2006 11:46:42 -0500 Date: Mon, 2 Jan 2006 17:46:06 +0100 From: Andi Kleen To: Ingo Molnar Cc: lkml , Linus Torvalds , Andrew Morton , Arjan van de Ven , Nicolas Pitre , Jes Sorensen , Al Viro , Oleg Nesterov , David Howells , Alan Cox , Christoph Hellwig , Andi Kleen , Russell King Subject: Re: [patch 05/19] mutex subsystem, add include/asm-x86_64/mutex.h Message-ID: <20060102164605.GB7222@wotan.suse.de> References: <20060102163354.GF31501@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060102163354.GF31501@elte.hu> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 02, 2006 at 05:33:54PM +0100, Ingo Molnar wrote: > + __asm__ __volatile__( \ > + LOCK " decl (%%rdi) \n" \ > + " js 2f \n" \ > + "1: \n" \ > + \ > + LOCK_SECTION_START("") \ > + "2: call "#fail_fn" \n" \ > + " jmp 1b \n" \ > + LOCK_SECTION_END \ > + \ > + :"=D" (dummy) \ > + : "D" (v) \ > + : "rax", "rsi", "rdx", "rcx", \ > + "r8", "r9", "r10", "r11", "memory"); \ I think it would be still better if you used the stubs in arch/x86_64/lib/thunk.S and not clobber all the registers. While it won't make that much difference for the out of line mutexes it will generate better code for inline mutexes, and if someone ever decides they're a good idea the code will be ready. -Andi