From patchwork Fri Mar 28 15:01:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 27314 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C6FE20545 for ; Fri, 28 Mar 2014 16:00:00 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id jt11sf12433712pbb.11 for ; Fri, 28 Mar 2014 09:00:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=1scVPBNv9IhLgHRJ1lY8uuMKtlYNt7gfzTEkhSNRWMQ=; b=UIAmpVLcdSLnk4ClCqO3cSA17oRp0NjWiELy8/BgkFNL5cMqEth62RYASbaAaQQFxZ jSaEawZS1XfCUayWImv/xDBM2OC/XST13EqBNMlEV5CrUOnhD/qDNhVXJezl1EtGDl7Q nijdCTbCYFKWoLyLXFgfCBfzkkdLtEKavpIH3wo9OKrQcFlugf8We/3M/KSs8mgolWJ8 G+COhOHJgImdxiKifppjvV8iMU7ExylUK3Zpgeo+fN9MY90fn/hJGC6UEfo71vgAIASW HGEGxoWFWbg9Pik96Sne5FU5P03nNwoS4HSQucP31CLvmqJN7OEr7iBt65WRLcmN8pNK Nong== X-Gm-Message-State: ALoCoQncjW3fJ5Zv5b6CLd/oC0K8HuqQ1QScmA8K8xg0RNoj4TON700W30CRIL/yqM/8md548uPc X-Received: by 10.67.21.145 with SMTP id hk17mr2231605pad.35.1396022400222; Fri, 28 Mar 2014 09:00:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.230 with SMTP id m93ls661990qge.87.gmail; Fri, 28 Mar 2014 09:00:00 -0700 (PDT) X-Received: by 10.58.126.4 with SMTP id mu4mr8017460veb.0.1396022400112; Fri, 28 Mar 2014 09:00:00 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id gs7si1320004vdc.38.2014.03.28.09.00.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 09:00:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so6064242vcb.14 for ; Fri, 28 Mar 2014 09:00:00 -0700 (PDT) X-Received: by 10.220.96.70 with SMTP id g6mr7704181vcn.19.1396022399983; Fri, 28 Mar 2014 08:59:59 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp19598vcv; Fri, 28 Mar 2014 08:59:59 -0700 (PDT) X-Received: by 10.180.87.162 with SMTP id az2mr13704266wib.23.1396022398772; Fri, 28 Mar 2014 08:59:58 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id f9si2488260wix.75.2014.03.28.08.59.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Mar 2014 08:59:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTYKN-00060q-V8; Fri, 28 Mar 2014 15:04:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTYJi-0008IP-Cr; Fri, 28 Mar 2014 15:03:34 +0000 Received: from mail-we0-f174.google.com ([74.125.82.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTYIN-00086u-UQ for linux-arm-kernel@lists.infradead.org; Fri, 28 Mar 2014 15:02:28 +0000 Received: by mail-we0-f174.google.com with SMTP id t60so2784924wes.33 for ; Fri, 28 Mar 2014 08:01:50 -0700 (PDT) X-Received: by 10.180.102.42 with SMTP id fl10mr48370140wib.42.1396018910099; Fri, 28 Mar 2014 08:01:50 -0700 (PDT) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id fo6sm8038670wib.7.2014.03.28.08.01.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Mar 2014 08:01:49 -0700 (PDT) From: Steve Capper To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, linux@arm.linux.org.uk, linux-mm@kvack.org, linux-arch@vger.kernel.org Subject: [RFC PATCH V4 6/7] arm64: mm: Enable HAVE_RCU_TABLE_FREE logic Date: Fri, 28 Mar 2014 15:01:31 +0000 Message-Id: <1396018892-6773-7-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396018892-6773-1-git-send-email-steve.capper@linaro.org> References: <1396018892-6773-1-git-send-email-steve.capper@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140328_110212_174563_51CE4F81 X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.174 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: peterz@infradead.org, gary.robertson@linaro.org, akpm@linux-foundation.org, anders.roxell@linaro.org, Steve Capper X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 In order to implement fast_get_user_pages we need to ensure that the page table walker is protected from page table pages being freed from under it. This patch enables HAVE_RCU_TABLE_FREE, any page table pages belonging to address spaces with multiple users will be call_rcu_sched freed. Meaning that disabling interrupts will block the free and protect the fast gup page walker. Signed-off-by: Steve Capper --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/tlb.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 27bbcfc..6185f95 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -38,6 +38,7 @@ config ARM64 select HAVE_MEMBLOCK select HAVE_PATA_PLATFORM select HAVE_PERF_EVENTS + select HAVE_RCU_TABLE_FREE select IRQ_DOMAIN select MODULES_USE_ELF_RELA select NO_BOOTMEM diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h index 72cadf5..58a8b78 100644 --- a/arch/arm64/include/asm/tlb.h +++ b/arch/arm64/include/asm/tlb.h @@ -22,6 +22,14 @@ #include +#include +#include + +static inline void __tlb_remove_table(void *_table) +{ + free_page_and_swap_cache((struct page *)_table); +} + /* * There's three ways the TLB shootdown code is used: * 1. Unmapping a range of vmas. See zap_page_range(), unmap_region().