From patchwork Thu Feb 15 15:29:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 128492 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2015921ljc; Thu, 15 Feb 2018 09:56:11 -0800 (PST) X-Google-Smtp-Source: AH8x2251zJYMBa/pLw4jPSMoKwKWfaae2XOk8dzaH1anmlB83TWJUFN6C3I8kuDTs2xyIw/Apqhy X-Received: by 2002:a17:902:7883:: with SMTP id q3-v6mr3241707pll.361.1518717371069; Thu, 15 Feb 2018 09:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518717371; cv=none; d=google.com; s=arc-20160816; b=Hx9wc+9GTSgCUlGBGdSCGCzEiH0SR6dYntTKcslvwJQpmXcf8TqCPZDNNeVwTvdS6b iV3hhpBetRmupi7ew52LyQtkCoLl3G2/x/F4ewd/wTCNjYElRxSReCcUZV2tefjgqHEM 1P3Zj54o0kmaY6WR3c2ZLSYsca2YzXn7dstz/AEVc26ectlpdI6CIeTr3lHB6IiGLSCy 8rUPi4o8CHxs/bkf+fnHRK34g/ofEFB7y2RdMZaaa5WzEnVhEOj4Art/zqCcnpd9LFX0 crIz7FxLhN54ygy0n/Pe6UgZCEfRAOibif2ZI9lD5ZC7BE44RGgYGawax4FE5i722uT/ Hn2A== 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=4r7EebpepFZi7635jeqa87IHx65v6YdFymLWxAHGpGE=; b=vK0UR64czqSZifJffnqk+dHa4m59tbxtiEBRFgn6NkMETaa5BoG+GrJaZ6/HMVRm76 btuhvI2KRXMF9+UsS1FVtYySRSgnI25w/OWkYXZj7ydYheWT5S767bRE3gs8tPfnRNIM EwW3J1V2Y/P5AEBaeQGVtfTMBaYKRq0pgA8dtOH+8g/SCQu8fsBqjh9rV9P0L03TKB1L Ouxpd7A4i/QINUFFuFXhuuKk0GScadT3GGWK5IjBdr4zBDo2VSqmUHwo3GMsSr7FR2E0 IHWFj9tpwpkbs9u5IfvjLuhW4vPMsVaoTzxSNymrpbScOU36oS9fPhyipDvuCjWvLWWh t+Ug== 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 l19si1163149pgo.629.2018.02.15.09.56.10; Thu, 15 Feb 2018 09:56:11 -0800 (PST) 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 S1165924AbeBOR4G (ORCPT + 28 others); Thu, 15 Feb 2018 12:56:06 -0500 Received: from foss.arm.com ([217.140.101.70]:55958 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164177AbeBOPaO (ORCPT ); Thu, 15 Feb 2018 10:30:14 -0500 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 3A2921435; Thu, 15 Feb 2018 07:30:14 -0800 (PST) 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 0AFDE3F24D; Thu, 15 Feb 2018 07:30:14 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 7110A1AE5467; Thu, 15 Feb 2018 15:30:21 +0000 (GMT) From: Will Deacon To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, peterz@infradead.org, mingo@kernel.org, Will Deacon Subject: [RFC PATCH 0/5] Rewrite asm-generic/bitops/atomic.h and use on arm64 Date: Thu, 15 Feb 2018 15:29:30 +0000 Message-Id: <1518708575-12284-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, Whilst investigating a livelock in fs/dcache.c [1], I noticed that the arm64 test_and_set operation always writes back to memory even if the value is already set. This led me to start hacking on improved versions of our bitops, including an acquire version of test_and_set_bit_lock. Since there was nothing arm64-specific about the resulting code, I figured I'd replace what's sitting in asm-generic/bitops/atomic.h and simply include that instead. I had to rejig a couple of #includes so that I can call into atomic_* ops from bitops.h, but that was actually pretty straightforward. Feedback welcome, Will [1] https://lkml.org/lkml/2018/2/13/414 --->8 Will Deacon (5): arm64: fpsimd: include in fpsimd.h asm-generic: Avoid including linux/kernel.h in asm-generic/bug.h asm-generic/bitops/atomic.h: Rewrite using atomic_fetch_* arm64: Replace our atomic bitops implementation with asm-generic arm64: bitops: Include arch/arm64/include/asm/bitops.h | 20 +--- arch/arm64/include/asm/fpsimd.h | 1 + arch/arm64/lib/Makefile | 2 +- arch/arm64/lib/bitops.S | 76 ------------- include/asm-generic/bitops/atomic.h | 219 ++++++++++++------------------------ include/asm-generic/bug.h | 2 +- lib/errseq.c | 1 + 7 files changed, 77 insertions(+), 244 deletions(-) delete mode 100644 arch/arm64/lib/bitops.S -- 2.1.4