From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965168AbVLVQo7 (ORCPT ); Thu, 22 Dec 2005 11:44:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965169AbVLVQo7 (ORCPT ); Thu, 22 Dec 2005 11:44:59 -0500 Received: from mx3.mail.elte.hu ([157.181.1.138]:52664 "EHLO mx3.mail.elte.hu") by vger.kernel.org with ESMTP id S965168AbVLVQo6 (ORCPT ); Thu, 22 Dec 2005 11:44:58 -0500 Date: Thu, 22 Dec 2005 17:44:15 +0100 From: Ingo Molnar To: Nicolas Pitre Cc: Christoph Hellwig , lkml , Linus Torvalds , Andrew Morton , Arjan van de Ven , Jes Sorensen , Zwane Mwaikambo , Oleg Nesterov , David Howells , Alan Cox , Benjamin LaHaise , Steven Rostedt , Andi Kleen , Russell King Subject: Re: [patch 0/9] mutex subsystem, -V4 Message-ID: <20051222164415.GA10628@elte.hu> References: <20051222114147.GA18878@elte.hu> <20051222115329.GA30964@infradead.org> <20051222154012.GA6284@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-ELTE-SpamScore: 0.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=0.0 required=5.9 tests=AWL autolearn=no SpamAssassin version=3.0.3 0.0 AWL AWL: From: address is in the auto white-list X-ELTE-VirusStatus: clean Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org * Nicolas Pitre wrote: > > i'm curious, how would this ARMv6 solution look like, and what would be > > the advantages over the atomic swap based variant? > > On ARMv6 (which can be SMP) the atomic swap instruction is much more > costly than on former ARM versions. It however has ll/sc instructions > which allows it to implement a true atomic decrement, and the lock > fast path would look like: [...] but couldnt you implement atomic_dec_return() with the ll/sc instructions? Something like: repeat: ldrex r1, [r0] sub r1, r1, #1 strex r2, r1, [r0] orrs r0, r2, r1 jneq repeat (shot-in-the-dark guess at ARMv6 assembly) hm? Ingo