From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752978AbcFCXFa (ORCPT ); Fri, 3 Jun 2016 19:05:30 -0400 Received: from g2t4620.austin.hp.com ([15.73.212.81]:56403 "EHLO g2t4620.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751629AbcFCXF2 (ORCPT ); Fri, 3 Jun 2016 19:05:28 -0400 Message-ID: <1464995089.2367.7.camel@j-VirtualBox> Subject: Re: [RFC][PATCH 0/7] locking/rwsem: Convert rwsem count to atomic_long_t From: Jason Low To: Peter Zijlstra Cc: jason.low2@hp.com, Ingo Molnar , Linus Torvalds , Ingo Molnar , Linux Kernel Mailing List , Andrew Morton , Richard Henderson , Ivan Kokshaysky , Matt Turner , Tony Luck , Fenghua Yu , Martin Schwidefsky , Terry Rudd , Heiko Carstens , Thomas Gleixner , Arnd Bergmann , Christoph Lameter , Davidlohr Bueso , Waiman Long , Tim Chen , Peter Hurley Date: Fri, 03 Jun 2016 16:04:49 -0700 In-Reply-To: <20160603223620.GB3727@twins.programming.kicks-ass.net> References: <1463445486-16078-1-git-send-email-jason.low2@hpe.com> <20160517110906.GW3193@twins.programming.kicks-ass.net> <20160603080407.GA12056@gmail.com> <1464977394.3289.13.camel@j-VirtualBox> <20160603223620.GB3727@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2016-06-04 at 00:36 +0200, Peter Zijlstra wrote: > On Fri, Jun 03, 2016 at 11:09:54AM -0700, Jason Low wrote: > > --- a/arch/alpha/include/asm/rwsem.h > > +++ b/arch/alpha/include/asm/rwsem.h > > @@ -25,8 +25,8 @@ static inline void __down_read(struct rw_semaphore *sem) > > { > > long oldcount; > > #ifndef CONFIG_SMP > > - oldcount = sem->count; > > - sem->count += RWSEM_ACTIVE_READ_BIAS; > > + oldcount = atomic_long_read(&sem->count); > > + atomic_long_add(RWSEM_ACTIVE_READ_BIAS, &sem->count); > > #else > > That _completely_ misses the point of the whole !SMP code. Oh right, this defeats the purpose of the additional code path. Might as well have removed the code entirely :\ I can send out a new patch assuming we're still keeping all the arch/*/ rwsem.h?