From patchwork Thu Jan 29 18:56:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sullivan X-Patchwork-Id: 5744761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F00889F399 for ; Thu, 29 Jan 2015 19:13:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 100362025B for ; Thu, 29 Jan 2015 19:13:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C7EF220251 for ; Thu, 29 Jan 2015 19:13:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGuUp-0006xd-Mq; Thu, 29 Jan 2015 19:11:19 +0000 Received: from skprod2.natinst.com ([130.164.80.23] helo=ni.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGuUn-0006vW-1h for linux-arm-kernel@lists.infradead.org; Thu, 29 Jan 2015 19:11:17 +0000 Received: from us-aus-mgwout1.amer.corp.natinst.com (nb-snip2-1338.natinst.com [130.164.19.135]) by us-aus-skprod2.natinst.com (8.14.5/8.14.5) with ESMTP id t0TJAlNs023222; Thu, 29 Jan 2015 13:10:47 -0600 Received: from nathan3500-linux-VM ([130.164.14.198]) by us-aus-mgwout1.amer.corp.natinst.com (Lotus Domino Release 8.5.3FP6) with ESMTP id 2015012913104710-508858 ; Thu, 29 Jan 2015 13:10:47 -0600 Date: Thu, 29 Jan 2015 12:56:18 -0600 From: Nathan Sullivan To: yong.zhang@windriver.com Subject: __HAVE_ARCH_CMPXCHG on ARM? Message-ID: <20150129185618.GA31459@nathan3500-linux-VM> MIME-Version: 1.0 User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 01/29/2015 01:10:47 PM, Serialize by Router on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 01/29/2015 01:10:47 PM, Serialize complete at 01/29/2015 01:10:47 PM Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68, 1.0.33, 0.0.0000 definitions=2015-01-29_06:2015-01-29, 2015-01-29, 1970-01-01 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150129_111117_255995_EB95818B X-CRM114-Status: GOOD ( 12.70 ) X-Spam-Score: -0.0 (/) Cc: yong.zhang0@gmail.com, will.deacon@arm.com, linux-rt-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While investigating a performance issue on RT 3.14, I noticed that __HAVE_ARCH_CMPXCHG is not defined for ARM. This causes -rt locks to always use the slow path and impacts performance. ARMv6 and above have a cmpxchg implementation already that will work just fine. In 2012, Yong Zhang submitted a patch to fix this[1], but it mysteriously disappeared afterwards. I did notice that the s-o-b line has a different email address than the windriver one. Yong, do you mind re-submitting the patch with a fixed s-o-b? Thanks! Nathan Sullivan [1]: http://lists.infradead.org/pipermail/linux-arm-kernel/2012-May/102122.html (duplicated below) -- 8< -- From: Yong Zhang Both pi_stress and sigwaittest in rt-test show performance gain with __HAVE_ARCH_CMPXCHG. Testing result on coretile_express_a9x4: pi_stress -p 99 --duration=300 (on linux-3.4-rc5; bigger is better) vanilla: Total inversion performed: 5493381 patched: Total inversion performed: 5621746 sigwaittest -p 99 -l 100000 (on linux-3.4-rc5-rt6; less is better) 3.4-rc5-rt6: Min 24, Cur 27, Avg 30, Max 98 patched: Min 19, Cur 21, Avg 23, Max 96 Signed-off-by: Yong Zhang Cc: Russell King Cc: Nicolas Pitre Cc: Will Deacon Cc: Catalin Marinas Cc: Thomas Gleixner Cc: linux-arm-kernel at lists.infradead.org --- arch/arm/include/asm/cmpxchg.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h index 7eb18c1..a91b44e 100644 --- a/arch/arm/include/asm/cmpxchg.h +++ b/arch/arm/include/asm/cmpxchg.h @@ -127,6 +127,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size #else /* min ARCH >= ARMv6 */ +#define __HAVE_ARCH_CMPXCHG 1 + extern void __bad_cmpxchg(volatile void *ptr, int size); /*