From patchwork Thu Oct 5 12:54:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 114933 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp193560edb; Thu, 5 Oct 2017 05:55:13 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDNlyhZsHPUxtciBLx3Jh2u9ps6B31A0fcm8or9WFwDTalAc1yr/xyIz9rbWKYAuo7Mpre5 X-Received: by 10.159.216.151 with SMTP id s23mr12273295plp.176.1507208113461; Thu, 05 Oct 2017 05:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507208113; cv=none; d=google.com; s=arc-20160816; b=XaTeReHZPYPgoZpv3ln+OYGLoA6pobaqRM33PDejRX1BAybZldUYR9p4BwMubNxZJd tmam4sCaKaB62NnwenSjD9YKNhNAozQuWY4+2vHtbAezhYJC2LDwD74isYGis9xbNRUG UQ7fsBDjIGKBCcPXTCw/tacKHxTthVo8T5iw6w/G+Hd/zl+MklDYoX3bIu9DbZhd4YpZ zZrzEIfrw7O9Kn8LPVnMnrKnpoUNhQ4nXunKK85RVWl53uGAcjc9hmiGlXR05MoDrUlv Y8Mrs7ueSJwSPrcF0IU8gWU24sTaEO+wgm0BJbocGLhGeP0NMLE9Ii/VGq+RcamZW4+E 9AEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QvUc9CWPLrnadK+NZWG2xwpmbigSAgbhuP3Vmh2PNNU=; b=hYZjmV1Lw/Iq9bqMfx68BMnXDN6ERPsGdi7eVdrJgP3ETAsWi/Bmn+P9db4eGhg+QQ Sd7iOrY8+BtZGUbhel5qkrT9qYIs4OFTr9bi2FilYXpigOqY18RQdROtYCemdDD3DIuK EL1mXj1mVmY6xkzfq8sl2OwPuOcp2S6V+X9pXWQvMvc9DWrn6LRcv7cMeMYuaCzjF3cU 4jr5/gTzfXumHLpTsTXyo7hDKOEzw7bqAJXzFoU7pt/mc39vvn/iuB3Ac34xDsUOfHP7 FmBQ6qpwzAQ182l5GJ8NcA2WQHRg8qevAfhU298WGNN77P7n+Y0n7KXX7r+vOOPW2eTN 2WBA== ARC-Authentication-Results: i=1; mx.google.com; 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 3si13927964pls.167.2017.10.05.05.55.13; Thu, 05 Oct 2017 05:55:13 -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; 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 S1751482AbdJEMy7 (ORCPT + 26 others); Thu, 5 Oct 2017 08:54:59 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44978 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbdJEMy5 (ORCPT ); Thu, 5 Oct 2017 08:54:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8D82C1529; Thu, 5 Oct 2017 05:54:57 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5E61D3F483; Thu, 5 Oct 2017 05:54:57 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id A8FF41AE2DD7; Thu, 5 Oct 2017 13:54:58 +0100 (BST) From: Will Deacon To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Jeremy.Linton@arm.com, peterz@infradead.org, mingo@redhat.com, longman@redhat.com, boqun.feng@gmail.com, paulmck@linux.vnet.ibm.com, Will Deacon Subject: [PATCH 0/6] Switch arm64 over to qrwlock Date: Thu, 5 Oct 2017 13:54:51 +0100 Message-Id: <1507208097-825-1-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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! 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(-) -- 2.1.4