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: 3905321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2452E9F2E8 for ; Fri, 28 Mar 2014 17:13:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4936D202FE for ; Fri, 28 Mar 2014 17:13:32 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A53520108 for ; Fri, 28 Mar 2014 17:13:31 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTYKQ-00060r-84; Fri, 28 Mar 2014 15:04:19 +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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Nk1/PWRxps7NaxqZzRk4sQ42a7W0iS+qcMHsjCUyuQQ=; b=cM1/kvaMlXno0Ae1IQUOZNRIk97xG47vxUv5ss2kVRqSdrnbjvnJfEPWWQPkgZV1rb 5QFefJMNKBJBMEGzYz8o/DTX+NHGQ7sAhEZCoYKASXZvdb3RVlKE4K/M+aCSCQWt29LI GV+7NEMIl+1wpbiSygkzTAzaYTSQrptk7BHJ5gbaqtKY1oJCatzbgaY2IUGBZoy3oJcb j2jjkB1mfha6bORQPkCtAJJJ0wctEtkz4GBSQCbQwL2j4CLgkVal8Ickz2NtLus52GKh ZeSgIHhOmOaPr+qsS1qa4wf3rL5K/AsSE3BEUXZPaALjzk/kXdsVRYzyXdtV2sfSxDMh +BqQ== X-Gm-Message-State: ALoCoQljF83YZfPsxSjJMZNhniju0EJ1DJrWoBDRxIfMhY+xP1VQtWmIDkQnsdWehHdVZgYdvpBK 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 (--) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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().