From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: arc_usr_cmpxchg and preemption Date: Thu, 15 Mar 2018 12:28:29 +0100 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-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1521105128.11552.64.camel@synopsys.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+gla-linux-snps-arc=m.gmane.org@lists.infradead.org To: Alexey Brodkin Cc: "linux-arch@vger.kernel.org" , "Vineet.Gupta1@synopsys.com" , "linux-snps-arc@lists.infradead.org" , "linux-kernel@vger.kernel.org" List-Id: linux-arch.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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Date: Thu, 15 Mar 2018 12:28:29 +0100 From: Peter Zijlstra 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> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Alexey Brodkin Cc: "Vineet.Gupta1@synopsys.com" , "linux-kernel@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" Message-ID: <20180315112829.DzFk1N9zTSP9D7crqYvMKTrgWUhGw4IZScJhbhoDU6E@z> 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.