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: 4752211 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 6B5569F344 for ; Wed, 20 Aug 2014 14:59:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D9AE20123 for ; Wed, 20 Aug 2014 14:59:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (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 7A0C320107 for ; Wed, 20 Aug 2014 14:59:29 +0000 (UTC) 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=F1uKx1A9biSaCqnlouBvs6ikP59lRM075LjW97hlaq4=; b=GnbetS/e08Cu8bVYhNkJLcFF3Wv9u/VnN5VX+zG56VKL7VrBiIyialQ0PP9m2OeDgu P2GY56ZWfn+T+VMH1RjNusQCcw+LNjyvwV7ClwPgYVoSODeDVLv7vQrPdE9DIPFDQNVk qVMUQR+7DFakSMDki5QIPc5rEpSIChy7e0xnD17ZNTF/3uwu+xONBRQpFVxPxFIqqrOx KFsoLyUL6JtcJxcpDkZ0MEpEe/ounZ9mqb+J8z5DnQWW19qVpk2yYKAIhVF9e5zHxgmn GoGqnGd2XyQqvQKth9SZf8s4zdP+sqme4yC9BYtgxew2DOJ1tLBbK6GzAPz1cbMOTDAG Hiag== X-Gm-Message-State: ALoCoQmLcxvQTsGOjH6zH4Ngsvhbt+VBNL+ase+1dCYI0AUGidNAslABh96/eh7wajPGfCoyKAko 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 (/) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 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