Received: by 10.213.65.68 with SMTP id h4csp1598345imn; Thu, 15 Mar 2018 04:31:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELsDUEnqL0Ljr0S/dWRoPflEKYbnFWduG5szzG25O3RJh+jZRAL/rPW1cU27K0Oh8qFlbM5x X-Received: by 10.101.98.85 with SMTP id q21mr6347892pgv.182.1521113496334; Thu, 15 Mar 2018 04:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521113496; cv=none; d=google.com; s=arc-20160816; b=t0M0T9ilwHlQKI/Aj7TBoITl20I4nATt3DntUUuIqEb31xApNevKbtoNIu4X1uNPqA Bl8iQGBw+6KE6J6xH+ATeKANO9lESmrcjbKKKTd8PxvOBG+/r10ZmtKDpfhUZWMd9vp1 FMjfouajs50j46lwWkxNDcS7P7X0pvcDYKrb4pCxM9OsdYoDiQEISLMcxKsnEBh8NuH6 dCcZVVM3OM0g9kAD5virYvxrWfoWivkoipUMP18oiZfvLNj1bfrjmqaiWw69FY8DdFS5 yD0SGb21LIuaEF913bOQh+MuFpPCFUXZ+5yF6keQ44RHH3I6ZLQuH1iRgbh4ZNjvi9Yk hdJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=MMbzY2tny1QikFKnER//hPsE78ZD8kCEhPHdPX8xOl0=; b=XFELersJ5md9FhcM8JymcvrOQjl4kdFfLyQrhwGPA2HZOQdRhZlbZFC+54k/TAgHRA i+LP75RI8BjO8Zd6bRjWRh2Xcw2a7FpFEKBCC1+LmsGwZtKxCc1guQs/6XHv7X+JJO4P x+twRr6EMxIxhlAiM4wvK1U069BqbwbmcJ/vhLcUMzL+iPhtDX3A67twdkFgT+GllPWh a4YxazKrI+sCPbjPZ2Vbh2GReF8VZopRntsyVRTxt0oBpUYwKggM95MiSr7MOeXUO1Nv Txb3ON9Ee8KL89x3q7b7LOKbaQUOZ8k/uuJapZWw+zAfKb0Dl/wZpvBkt+7Ff8e/bawp hN4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=mGUVup3u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1-v6si3876602plk.697.2018.03.15.04.31.21; Thu, 15 Mar 2018 04:31:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=mGUVup3u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751904AbeCOL2e (ORCPT + 99 others); Thu, 15 Mar 2018 07:28:34 -0400 Received: from merlin.infradead.org ([205.233.59.134]:48414 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751791AbeCOL2d (ORCPT ); Thu, 15 Mar 2018 07:28:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MMbzY2tny1QikFKnER//hPsE78ZD8kCEhPHdPX8xOl0=; b=mGUVup3uXBNNkstw7lb3jv9tp 1hhmjaX5ZC64p83z6/Cvscpj0eN5Cu0J1QQuwwP6nar5Hj2K4G9wvZB1W+UZSiubw/GPD0IBeDsqj x2jnCXY4CT/Pb3XxAKQFqwjmgKsDehtsX1ubSfoILMuBOaWy80IoH/U6xUgmR1mqDKvSK/eEBmc9l OtlD9ht5P/ZFYvud/w0xT6kPuQiQ79cxQOCXStTGyOHiYZOfIcApYDOFXGmBAaLrhP+5BHT8AHH/L zrqRDOYAPOhvowppiJDqy/XY2eTUJ4XX6l53Ofquwo0MFPj5jIbF6y1G++GtWog3X/fif67zUeYyY 4lPs9s6tg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewR3e-0002r6-LR; Thu, 15 Mar 2018 11:28:30 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 802872029F86E; Thu, 15 Mar 2018 12:28:29 +0100 (CET) Date: Thu, 15 Mar 2018 12:28:29 +0100 From: Peter Zijlstra To: Alexey Brodkin Cc: "Vineet.Gupta1@synopsys.com" , "linux-kernel@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" Subject: Re: arc_usr_cmpxchg and preemption Message-ID: <20180315112829.GW4064@hirez.programming.kicks-ass.net> References: <1521045375.11552.27.camel@synopsys.com> <20180314175352.GP4064@hirez.programming.kicks-ass.net> <1521059931.11552.51.camel@synopsys.com> <20180315081845.GS4064@hirez.programming.kicks-ass.net> <1521105128.11552.64.camel@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521105128.11552.64.camel@synopsys.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 09:12:09AM +0000, Alexey Brodkin wrote: > On Thu, 2018-03-15 at 09:18 +0100, Peter Zijlstra wrote: > > Also, it might make sense to stuff this implementation in some lib/ file > > somewhere and make all platforms that need it use the same code, afaict > > there really isn't anything platform specific to it. > > Not clear which part do you mean here. > Are you talking about entire cmpxchg syscall implementation? Yep. > Do you think there're many users of that quite an inefficient > [compared to proper HW version] atomic exchange? I think there's a bunch of architectures that are in the same boat. m68k, arm, mips was mentioned. Sure, the moment an arch has hardware support you don't need the syscall anymore. I was just thinking it would be good to have a common implementation (if possible) rather than 4-5 different copies of basically the same thing.