Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757263Ab1FUSDF (ORCPT ); Tue, 21 Jun 2011 14:03:05 -0400 Received: from claw.goop.org ([74.207.240.146]:35697 "EHLO claw.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752396Ab1FUSDB (ORCPT ); Tue, 21 Jun 2011 14:03:01 -0400 Message-ID: <4E00DAE2.8040109@goop.org> Date: Tue, 21 Jun 2011 10:54:42 -0700 From: Jeremy Fitzhardinge User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Peter Zijlstra CC: "H. Peter Anvin" , Ingo Molnar , the arch/x86 maintainers , Linux Kernel Mailing List , Nick Piggin , Jeremy Fitzhardinge Subject: Re: [PATCH RFC 0/7] x86: convert ticketlocks to C and remove duplicate code References: <1308664868.26237.173.camel@twins> In-Reply-To: <1308664868.26237.173.camel@twins> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1076 Lines: 35 On 06/21/2011 07:01 AM, Peter Zijlstra wrote: > No complaints from me, I rather like the result. OK, good. > One other thing you could contemplate is adding something like: > > #define xadd(ptr, inc) \ > do { \ > switch(sizeof(*(ptr))) { \ > case 1: \ > asm volatile (LOCK_PREFIX "xaddb %0, %1\n" \ > : "+r" (inc), "+m" (*(ptr)) \ > : : "memory", "cc"); \ > case 2: > ... xaddw ... > case 4: > ... xaddl ... > } while (0) > > and a similar something for inc. For both there seem to be various asm > bits left (we could even consider adding xadd to > arch/x86/include/asm/cmpxchg*.h). > > Also, you might have wanted to CC Linus on this, he's usually interested > in these bits. OK, I'll add the xadd/inc helpers and repost. J -- 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/