From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751639AbdJEWMy (ORCPT ); Thu, 5 Oct 2017 18:12:54 -0400 Received: from foss.arm.com ([217.140.101.70]:52480 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388AbdJEWMx (ORCPT ); Thu, 5 Oct 2017 18:12:53 -0400 Subject: Re: [PATCH 0/6] Switch arm64 over to qrwlock To: Will Deacon , linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, peterz@infradead.org, mingo@redhat.com, longman@redhat.com, boqun.feng@gmail.com, paulmck@linux.vnet.ibm.com References: <1507208097-825-1-git-send-email-will.deacon@arm.com> From: Jeremy Linton Message-ID: <9e2468c3-894e-1204-4578-3d8266c56d6c@arm.com> Date: Thu, 5 Oct 2017 17:12:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1507208097-825-1-git-send-email-will.deacon@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 10/05/2017 07:54 AM, Will Deacon wrote: > Hi all, > > This patch series reworks bits of the qrwlock code that it can be used > to replace the asm rwlocks currently implemented for arm64. The structure > of the series is: > > Patches 1-3 : Work WFE into qrwlock using atomic_cond_read_acquire so > we can avoid busy-waiting. > > Patch 4 : Enable qrwlocks for arm64 > > Patch 5-6 : Ensure writer slowpath fairness. This has a potential > performance impact on the writer unlock path, so I've > kept them at the end. > > The patches apply on top of my other locking cleanups: > > http://lkml.kernel.org/r/1507055129-12300-1-git-send-email-will.deacon@arm.com > > although the conflict with mainline is trivial to resolve without those. > The full stack is also pushed here: > > git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git qrwlock > > All comments (particularly related to testing and performance) welcome! I haven't done any perf testing, but the machines continue to boot, and the stress-ng test which causes task lock problems with the normal arm64 rwlock now appears to run as expected. So, its a good start! > > Cheers, > > Will > > --->8 > > Will Deacon (6): > kernel/locking: Use struct qrwlock instead of struct __qrwlock > locking/atomic: Add atomic_cond_read_acquire > kernel/locking: Use atomic_cond_read_acquire when spinning in qrwlock > arm64: locking: Move rwlock implementation over to qrwlocks > kernel/locking: Prevent slowpath writers getting held up by fastpath > kernel/locking: Remove unused union members from struct qrwlock > > arch/arm64/Kconfig | 17 ++++ > arch/arm64/include/asm/Kbuild | 1 + > arch/arm64/include/asm/spinlock.h | 164 +------------------------------- > arch/arm64/include/asm/spinlock_types.h | 6 +- > include/asm-generic/atomic-long.h | 3 + > include/asm-generic/qrwlock.h | 14 +-- > include/asm-generic/qrwlock_types.h | 2 +- > include/linux/atomic.h | 4 + > kernel/locking/qrwlock.c | 83 +++------------- > 9 files changed, 43 insertions(+), 251 deletions(-) > From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeremy.linton@arm.com (Jeremy Linton) Date: Thu, 5 Oct 2017 17:12:44 -0500 Subject: [PATCH 0/6] Switch arm64 over to qrwlock In-Reply-To: <1507208097-825-1-git-send-email-will.deacon@arm.com> References: <1507208097-825-1-git-send-email-will.deacon@arm.com> Message-ID: <9e2468c3-894e-1204-4578-3d8266c56d6c@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, On 10/05/2017 07:54 AM, Will Deacon wrote: > Hi all, > > This patch series reworks bits of the qrwlock code that it can be used > to replace the asm rwlocks currently implemented for arm64. The structure > of the series is: > > Patches 1-3 : Work WFE into qrwlock using atomic_cond_read_acquire so > we can avoid busy-waiting. > > Patch 4 : Enable qrwlocks for arm64 > > Patch 5-6 : Ensure writer slowpath fairness. This has a potential > performance impact on the writer unlock path, so I've > kept them at the end. > > The patches apply on top of my other locking cleanups: > > http://lkml.kernel.org/r/1507055129-12300-1-git-send-email-will.deacon at arm.com > > although the conflict with mainline is trivial to resolve without those. > The full stack is also pushed here: > > git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git qrwlock > > All comments (particularly related to testing and performance) welcome! I haven't done any perf testing, but the machines continue to boot, and the stress-ng test which causes task lock problems with the normal arm64 rwlock now appears to run as expected. So, its a good start! > > Cheers, > > Will > > --->8 > > Will Deacon (6): > kernel/locking: Use struct qrwlock instead of struct __qrwlock > locking/atomic: Add atomic_cond_read_acquire > kernel/locking: Use atomic_cond_read_acquire when spinning in qrwlock > arm64: locking: Move rwlock implementation over to qrwlocks > kernel/locking: Prevent slowpath writers getting held up by fastpath > kernel/locking: Remove unused union members from struct qrwlock > > arch/arm64/Kconfig | 17 ++++ > arch/arm64/include/asm/Kbuild | 1 + > arch/arm64/include/asm/spinlock.h | 164 +------------------------------- > arch/arm64/include/asm/spinlock_types.h | 6 +- > include/asm-generic/atomic-long.h | 3 + > include/asm-generic/qrwlock.h | 14 +-- > include/asm-generic/qrwlock_types.h | 2 +- > include/linux/atomic.h | 4 + > kernel/locking/qrwlock.c | 83 +++------------- > 9 files changed, 43 insertions(+), 251 deletions(-) >