From patchwork Fri Mar 28 15:01:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 3903981 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 920DB9F2B6 for ; Fri, 28 Mar 2014 15:05:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0E69202FF for ; Fri, 28 Mar 2014 15:05:18 +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 B8ECA202FE for ; Fri, 28 Mar 2014 15:05:17 +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 1WTYJv-0005kB-Ha; Fri, 28 Mar 2014 15:03:48 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTYJN-0008HJ-WE; Fri, 28 Mar 2014 15:03:14 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTYIb-0008DA-6M for linux-arm-kernel@merlin.infradead.org; Fri, 28 Mar 2014 15:02:25 +0000 Received: from mail-wg0-f47.google.com ([74.125.82.47]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WTYIZ-0005si-6z for linux-arm-kernel@lists.infradead.org; Fri, 28 Mar 2014 15:02:24 +0000 Received: by mail-wg0-f47.google.com with SMTP id x12so3600704wgg.6 for ; Fri, 28 Mar 2014 08:01:58 -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=RkDWIyGI2j9h/9tE1L8cQ9qDPS2T5k46UIUf+0Ea7NY=; b=aOvUFEAeiWF1tACbaWlBWLify4WlUuRNNCwacmxGtPwTkhQvqRZxBWiuA765WfHHBU VzanX7NyJFtPEaOz67ILRquC/y/rLQI3Fuopp4RWJOBVloL4fTOojwVj5GXYcaKFI6w7 lEDj0Z+ayqr2Mef6JVgJ6JveimAo9nEDV+Wx3ezwLR78mto15Cigqaxa+iYOJdMiNU5N tQ6L4uLlnr8J+IInixoMcHz9YiniUkzk/7qzYCcr3MGwS46LUoAKz1+Snbeqki5Kpu8f YeN6yvko9Tn9ZKto8xtfv+btRzPKT0OIpJiMVMvddnRpKJXU2xEPdwS7cdlh+rBKrZc7 S5jQ== X-Gm-Message-State: ALoCoQnQw2H4/9MbjBN9lpA1j+sX3asCcYJSUw8QzJFSlkap1uiQJKpYGPmxTT83/RslEMRGt/1N X-Received: by 10.180.75.49 with SMTP id z17mr5853151wiv.1.1396018911891; Fri, 28 Mar 2014 08:01:51 -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.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Mar 2014 08:01:51 -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 7/7] arm64: mm: Enable RCU fast_gup Date: Fri, 28 Mar 2014 15:01:32 +0000 Message-Id: <1396018892-6773-8-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_080223_426281_614B2528 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) 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 Activate the RCU fast_gup for ARM64. We also need to force THP splits to broadcast an IPI s.t. we block in the fast_gup page walker. As THP splits are comparatively rare, this should not lead to a noticeable performance degradation. Signed-off-by: Steve Capper --- arch/arm64/Kconfig | 3 +++ arch/arm64/include/asm/pgtable.h | 4 ++++ arch/arm64/mm/flush.c | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 6185f95..9f5a81a 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -86,6 +86,9 @@ config GENERIC_CSUM config GENERIC_CALIBRATE_DELAY def_bool y +config HAVE_RCU_GUP + def_bool y + config ZONE_DMA32 def_bool y diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index aa3917c..0e148ae 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -245,6 +245,10 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, #ifdef CONFIG_TRANSPARENT_HUGEPAGE #define pmd_trans_huge(pmd) (pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT)) #define pmd_trans_splitting(pmd) (pmd_val(pmd) & PMD_SECT_SPLITTING) +#define __HAVE_ARCH_PMDP_SPLITTING_FLUSH +struct vm_area_struct; +void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, + pmd_t *pmdp); #endif #define PMD_BIT_FUNC(fn,op) \ diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c index e4193e3..ddf96c1 100644 --- a/arch/arm64/mm/flush.c +++ b/arch/arm64/mm/flush.c @@ -103,3 +103,22 @@ EXPORT_SYMBOL(flush_dcache_page); */ EXPORT_SYMBOL(flush_cache_all); EXPORT_SYMBOL(flush_icache_range); + +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +#ifdef CONFIG_HAVE_RCU_TABLE_FREE +static void thp_splitting_flush_sync(void *arg) +{ +} + +void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, + pmd_t *pmdp) +{ + pmd_t pmd = pmd_mksplitting(*pmdp); + VM_BUG_ON(address & ~PMD_MASK); + set_pmd_at(vma->vm_mm, address, pmdp, pmd); + + /* dummy IPI to serialise against fast_gup */ + smp_call_function(thp_splitting_flush_sync, NULL, 1); +} +#endif /* CONFIG_HAVE_RCU_TABLE_FREE */ +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */