From patchwork Wed Aug 20 14:56:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 35692 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2632620351 for ; Wed, 20 Aug 2014 14:58:27 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id v10sf22737395qac.8 for ; Wed, 20 Aug 2014 07:58:24 -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:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=yWaMx8S3LlveworcFf49n3JniwU6/Q7l3P/6Tjw2vNw=; b=YX3qtAX6keVQc+QeDCxl/j3nvA8sFkYsVVKwO3LlvwrZ19McywgLna993WP202ivmO 4FH2N7FT5Gg/lzdixfrimJXcSzYLH4mQSSANdQV7cxd08XN9117f8F/Okukvvq4eXRj6 lubAA7S83iUUGAtjY56idQByoZykcrbD2uwQMAmHulcagQN8fW2zCwuZVMzogXcvnKvg c2hR6RTHUSkzTmNooL2QXMRsnUf2sdt1yb3pQYG3W75R4qKXCxgtnef7cNwYMJrfqJlh qzr5GGFLMGHKVnsj8h8/N9IXiAgH3N0zljT7oGDqJ9YCehvQaTLzLkfIrkWExxZaDVao 1Rpw== X-Gm-Message-State: ALoCoQljovMld6cNG6i3zSBB+wlch0Iv9/UerO515HxIYvSjXdx6b91qm6i9ricwmhB0JgtwQYmo X-Received: by 10.224.45.131 with SMTP id e3mr25624419qaf.1.1408546702686; Wed, 20 Aug 2014 07:58:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.202 with SMTP id w68ls280613qge.4.gmail; Wed, 20 Aug 2014 07:58:22 -0700 (PDT) X-Received: by 10.52.240.169 with SMTP id wb9mr1019060vdc.81.1408546702427; Wed, 20 Aug 2014 07:58:22 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id yw7si10717198vdb.63.2014.08.20.07.58.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Aug 2014 07:58:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so9310535vcb.11 for ; Wed, 20 Aug 2014 07:58:22 -0700 (PDT) X-Received: by 10.220.187.134 with SMTP id cw6mr1068883vcb.71.1408546702337; Wed, 20 Aug 2014 07:58:22 -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.221.45.67 with SMTP id uj3csp60128vcb; Wed, 20 Aug 2014 07:58:21 -0700 (PDT) X-Received: by 10.140.102.142 with SMTP id w14mr73730129qge.101.1408546701630; Wed, 20 Aug 2014 07:58:21 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id c96si2481049qgd.87.2014.08.20.07.58.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Aug 2014 07:58:19 -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 1XK7JT-0001w7-JQ; Wed, 20 Aug 2014 14:56:35 +0000 Received: from mail-we0-f173.google.com ([74.125.82.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XK7JQ-0001o9-N2 for linux-arm-kernel@lists.infradead.org; Wed, 20 Aug 2014 14:56:33 +0000 Received: by mail-we0-f173.google.com with SMTP id q58so8059747wes.4 for ; Wed, 20 Aug 2014 07:56:09 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.38.84 with SMTP id e20mr15379494wik.43.1408546569814; Wed, 20 Aug 2014 07:56:09 -0700 (PDT) Received: by 10.216.234.193 with HTTP; Wed, 20 Aug 2014 07:56:09 -0700 (PDT) In-Reply-To: <1403710824-24340-1-git-send-email-steve.capper@linaro.org> References: <1403710824-24340-1-git-send-email-steve.capper@linaro.org> Date: Wed, 20 Aug 2014 08:56:09 -0600 Message-ID: Subject: Re: [PATCH 0/6] RCU get_user_pages_fast and __get_user_pages_fast From: Dann Frazier To: Steve Capper X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140820_075632_913503_B5E99D01 X-CRM114-Status: GOOD ( 21.62 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 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.173 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.173 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: linux-arch@vger.kernel.org, anders.roxell@linaro.org, peterz@infradead.org, Catalin Marinas , Will Deacon , linux-mm@kvack.org, Christoffer Dall , gary.robertson@linaro.org, linux@arm.linux.org.uk, akpm@linux-foundation.org, linux-arm-kernel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , 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: dann.frazier@canonical.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) 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 On Wed, Jun 25, 2014 at 9:40 AM, Steve Capper wrote: > Hello, > This series implements general forms of get_user_pages_fast and > __get_user_pages_fast and activates them for arm and arm64. > > These are required for Transparent HugePages to function correctly, as > a futex on a THP tail will otherwise result in an infinite loop (due to > the core implementation of __get_user_pages_fast always returning 0). > > This series may also be beneficial for direct-IO heavy workloads and > certain KVM workloads. > > The main changes since RFC V5 are: > * Rebased against 3.16-rc1. > * pmd_present no longer tested for by gup_huge_pmd and gup_huge_pud, > because the entry must be present for these leaf functions to be > called. > * Rather than assume puds can be re-cast as pmds, a separate > function pud_write is instead used by the core gup. > * ARM activation logic changed, now it will only activate > RCU_TABLE_FREE and RCU_GUP when running with LPAE. > > The main changes since RFC V4 are: > * corrected the arm64 logic so it now correctly rcu-frees page > table backing pages. > * rcu free logic relaxed for pre-ARMv7 ARM as we need an IPI to > invalidate TLBs anyway. > * rebased to 3.15-rc3 (some minor changes were needed to allow it to merge). > * dropped Catalin's mmu_gather patch as that's been merged already. > > This series has been tested with LTP and some custom futex tests that > exacerbate the futex on THP tail case. Also debug counters were > temporarily employed to ensure that the RCU_TABLE_FREE logic was > behaving as expected. > > I would really appreciate any testers or comments (especially on the > validity or otherwise of the core fast_gup implementation). I have a test case that can reliably hit the THP issue on arm64, which hits it on both 3.16 and 3.17-rc1. I do a "juju bootstrap local" w/ THP disabled at boot. Then I reboot with THP enabled. At this point you'll see jujud spin at 200% CPU. gccgo binaries seem to have a nack for hitting it. I validated that your patches resolve this issue on 3.16, so: Tested-by: dann frazier I haven't done the same for 3.17-rc1 because they no longer apply cleanly, but I'm happy to test future submissions w/ hopefully a shorter feedback loop (please add me to the CC). btw, should we consider something like this until your patches go in? -dann > Cheers, > -- > Steve > > Steve Capper (6): > mm: Introduce a general RCU get_user_pages_fast. > arm: mm: Introduce special ptes for LPAE > arm: mm: Enable HAVE_RCU_TABLE_FREE logic > arm: mm: Enable RCU fast_gup > arm64: mm: Enable HAVE_RCU_TABLE_FREE logic > arm64: mm: Enable RCU fast_gup > > arch/arm/Kconfig | 5 + > arch/arm/include/asm/pgtable-2level.h | 2 + > arch/arm/include/asm/pgtable-3level.h | 16 ++ > arch/arm/include/asm/pgtable.h | 6 +- > arch/arm/include/asm/tlb.h | 38 ++++- > arch/arm/mm/flush.c | 19 +++ > arch/arm64/Kconfig | 4 + > arch/arm64/include/asm/pgtable.h | 11 +- > arch/arm64/include/asm/tlb.h | 18 ++- > arch/arm64/mm/flush.c | 19 +++ > mm/Kconfig | 3 + > mm/gup.c | 278 ++++++++++++++++++++++++++++++++++ > 12 files changed, 410 insertions(+), 9 deletions(-) > > -- > 1.9.3 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index fd4e81a..820e3d9 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -306,6 +306,7 @@ config ARCH_WANT_HUGE_PMD_SHARE config HAVE_ARCH_TRANSPARENT_HUGEPAGE def_bool y + depends on BROKEN config ARCH_HAS_CACHE_LINE_SIZE def_bool y