From patchwork Tue May 6 15:30:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 29716 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 988AB20534 for ; Tue, 6 May 2014 15:32:54 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf22382228oag.4 for ; Tue, 06 May 2014 08:32:54 -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=RpDVq0RHk7QFCZxPk95CPeBOIruS3ZwMtWjjvfup5ww=; b=hbV+stRdeuHXFtUbr8egVhGpVgTj/Pv9xzh/2OGYh8TSeMIPih8EuM1PyDznkuEYkE WyzwceWekWKpZRbHfHkLi9RZWU7HF8i5x+lq8FsohmMFv4GkwvDNEasgeGPvc/Xdc/Ib /5DxGqa++xrpSOIwb2VkVD+1OnA+g5EXaQxfZ8V5UxvvtxJJpBLQAZ9q/GtDE2/hjhuW PH78xtTxAW7fX24ic7JPEP2YLjf6hS2YxhJRfUUqFG3mlolqQSiflCqq2W6fbtpmT7Q5 CbDdv5sj21pWV/8EF6Aah8G+g64Uxb+yAFmcWktK/1D/CXHCa+dz52eHUK8MkH5ZTqSo HXHQ== X-Gm-Message-State: ALoCoQkGji/mC1WhiVOl048n2j5qoyE4qnkHz1uyC5d4xQizZxmEzhVpuU0b7vAhUA4o9JcPe2G7 X-Received: by 10.42.115.129 with SMTP id k1mr1271715icq.25.1399390373923; Tue, 06 May 2014 08:32:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.4 with SMTP id 4ls53214qgy.39.gmail; Tue, 06 May 2014 08:32:53 -0700 (PDT) X-Received: by 10.58.120.46 with SMTP id kz14mr2530752veb.25.1399390373703; Tue, 06 May 2014 08:32:53 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id q3si1262295veh.36.2014.05.06.08.32.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 May 2014 08:32:53 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jw12so3919318veb.5 for ; Tue, 06 May 2014 08:32:53 -0700 (PDT) X-Received: by 10.52.38.5 with SMTP id c5mr658545vdk.85.1399390373603; Tue, 06 May 2014 08:32:53 -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.221.72 with SMTP id ib8csp233210vcb; Tue, 6 May 2014 08:32:51 -0700 (PDT) X-Received: by 10.224.54.68 with SMTP id p4mr55913226qag.47.1399390366741; Tue, 06 May 2014 08:32:46 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v6si5279376qas.91.2014.05.06.08.32.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 May 2014 08:32:46 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WhhLC-0000Sz-Us; Tue, 06 May 2014 15:31:34 +0000 Received: from mail-we0-f179.google.com ([74.125.82.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WhhKX-0008Gx-5w for linux-arm-kernel@lists.infradead.org; Tue, 06 May 2014 15:30:54 +0000 Received: by mail-we0-f179.google.com with SMTP id q59so6703213wes.24 for ; Tue, 06 May 2014 08:30:31 -0700 (PDT) X-Received: by 10.180.160.166 with SMTP id xl6mr21465857wib.42.1399390231656; Tue, 06 May 2014 08:30:31 -0700 (PDT) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id ho2sm2330106wib.15.2014.05.06.08.30.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 May 2014 08:30:31 -0700 (PDT) From: Steve Capper To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, linux@arm.linux.org.uk, linux-arch@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH V5 4/6] arm: mm: Enable RCU fast_gup Date: Tue, 6 May 2014 16:30:07 +0100 Message-Id: <1399390209-1756-5-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399390209-1756-1-git-send-email-steve.capper@linaro.org> References: <1399390209-1756-1-git-send-email-steve.capper@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140506_083053_431173_98D83149 X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.179 listed in list.dnswl.org] Cc: anders.roxell@linaro.org, peterz@infradead.org, gary.robertson@linaro.org, will.deacon@arm.com, Steve Capper , akpm@linux-foundation.org, christoffer.dall@linaro.org 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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 Activate the RCU fast_gup for ARM. 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/arm/Kconfig | 3 +++ arch/arm/include/asm/pgtable-3level.h | 6 ++++++ arch/arm/mm/flush.c | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 6cfdb3b..d0572f1 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1803,6 +1803,9 @@ config ARCH_SELECT_MEMORY_MODEL config HAVE_ARCH_PFN_VALID def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM +config HAVE_RCU_GUP + def_bool y + config HIGHMEM bool "High Memory Support" depends on MMU diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h index b286ba9..fdc4a4f 100644 --- a/arch/arm/include/asm/pgtable-3level.h +++ b/arch/arm/include/asm/pgtable-3level.h @@ -226,6 +226,12 @@ static inline pte_t pte_mkspecial(pte_t pte) #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) + +#ifdef CONFIG_HAVE_RCU_TABLE_FREE +#define __HAVE_ARCH_PMDP_SPLITTING_FLUSH +void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, + pmd_t *pmdp); +#endif #endif #define PMD_BIT_FUNC(fn,op) \ diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 3387e60..91a2b59 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c @@ -377,3 +377,22 @@ void __flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned l */ __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE); } + +#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 */