Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755735AbbESMno (ORCPT ); Tue, 19 May 2015 08:43:44 -0400 Received: from casper.infradead.org ([85.118.1.10]:52679 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755500AbbESMnk (ORCPT ); Tue, 19 May 2015 08:43:40 -0400 Date: Tue, 19 May 2015 14:43:33 +0200 From: Peter Zijlstra To: Sarbojit Ganguly Cc: Arnd Bergmann , "linux-arm-kernel@lists.infradead.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "Waiman.Long@hp.com" , "raghavendra.kt@linux.vnet.ibm.com" , "oleg@redhat.com" , "linux-kernel@vger.kernel.org" , SHARAN ALLUR , "torvalds@linux-foundation.org" , "vikram.m@samsung.com" Subject: Re: [RFC] arm: Add for atomic half word exchange Message-ID: <20150519124333.GC3644@twins.programming.kicks-ass.net> References: <1795987946.405311432034410830.JavaMail.weblogic@ep2mlwas07a> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1795987946.405311432034410830.JavaMail.weblogic@ep2mlwas07a> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1043 Lines: 24 On Tue, May 19, 2015 at 11:20:13AM +0000, Sarbojit Ganguly wrote: > On Tuesday 19 May 2015 09:39:33 Sarbojit Ganguly wrote: > > Since 16 bit half word exchange was not there and MCS based > > qspinlock by Waiman's xchg_tail() requires an atomic exchange on a > > half word, here is a small modification to __xchg() code. Can you actually see a performance improvement with the qspinlock code on ARM ? The real improvements on x86 were on NUMA systems; although there were real improvements on light loads as well. Note that ARM (or any load-store arch) could get rid of all the cmpxchg loops in that code. Although I suppose we replaced the most common ones with these unconditional atomics already -- like that xchg16 -- so implementing those with ll/sc, as you did, should be near optimal. -- 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/