From patchwork Wed Mar 2 22:56:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 8486641 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 150259F314 for ; Wed, 2 Mar 2016 22:59:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3554C2025B for ; Wed, 2 Mar 2016 22:59:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4857420254 for ; Wed, 2 Mar 2016 22:59:15 +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 1abFiC-0002qm-7n; Wed, 02 Mar 2016 22:57:44 +0000 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1abFhE-0002An-Iw for linux-arm-kernel@lists.infradead.org; Wed, 02 Mar 2016 22:56:47 +0000 Received: by mail-pa0-x242.google.com with SMTP id hj7so209018pac.1 for ; Wed, 02 Mar 2016 14:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fNgKQPUx/55xqwTUhpk0OIhWaNJqvDZcVjkfs2LH5HE=; b=Z3PCWoWTAMA0d7mCeb/8jioNC7IFjL+CQ3wSmLuBCzQF1IIKYadBSJN5Z/mtFhNdgt te2KJJfnvXgVEHg3iHr4WrnPoAmANfu62PB/YQzpLKENzMY8oo1sqNdjggVuEU8jW2EU hCmycb0mneh/UfVsF1ZZMFRDh7ALSDwnBqmemf2NLjzDqy14WhPZrXC28bVVWuvlTF48 JCs/WAFDIwUKhnHurMXIb31xMYERWktWkNTdOn7rXUI+mUkFSNq3kO9sUY4dwHmUvqUT NlBxnjxRx/aZGJy4sSntuTcDDl4g6Pn0GoUwkP8UM52twkvnLhIK6DJO8+zWsX1XNV09 ghwQ== 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=fNgKQPUx/55xqwTUhpk0OIhWaNJqvDZcVjkfs2LH5HE=; b=OU+6pPuaC85PC9OllqquC4KN1HeIrK5HyxGfso4RELMS1HdoBZ/cKDILGMpQIvDHvF vdouRsTdcS3kJsNPuB66OyRHwJMxs/Jlk0ZC0XYQp7RaW8crER8HrqzdtgNwxpNXLffv 8ay3mXW0om/xxyL5jsFvp23H4HNXTlfmBZnYY3VIixJCFxZ011kguv7hWU1uk+5Bei5T 5B39w+iF3XvyhB5eeKELYhzzwL0W3M4l3xOe6AjcyDhkB4GvL/dyApOHTP61MsTD3W5A TFePklPkfYSFyhm7KjyYsWG2ACuaA3UO2ci9JtxrhPPIEgv7MbH17PQDXeLnkVIRk//F 6zDQ== X-Gm-Message-State: AD7BkJJxgbQzXU+LcgKqVC+tdvyq/qfVp7jS3xKfPmtq2css9FB7vVCILYwwsIa5Ta2pBQ== X-Received: by 10.66.63.41 with SMTP id d9mr27912752pas.1.1456959384847; Wed, 02 Mar 2016 14:56:24 -0800 (PST) Received: from dl.caveonetworks.com ([64.2.3.194]) by smtp.gmail.com with ESMTPSA id h85sm41256515pfj.52.2016.03.02.14.56.15 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 02 Mar 2016 14:56:19 -0800 (PST) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id u22MuEov002099; Wed, 2 Mar 2016 14:56:14 -0800 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u22MuEfP002098; Wed, 2 Mar 2016 14:56:14 -0800 From: David Daney To: Will Deacon , linux-arm-kernel@lists.infradead.org, Rob Herring , Frank Rowand , Grant Likely , Pawel Moll , Ian Campbell , Kumar Gala , Ganapatrao Kulkarni , Robert Richter , Ard Biesheuvel , Matt Fleming , Mark Rutland , Catalin Marinas Subject: [PATCH v13 6/6] arm64, mm, numa: Add NUMA balancing support for arm64. Date: Wed, 2 Mar 2016 14:56:02 -0800 Message-Id: <1456959362-2036-7-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1456959362-2036-1-git-send-email-ddaney.cavm@gmail.com> References: <1456959362-2036-1-git-send-email-ddaney.cavm@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160302_145644_907272_62528C0A X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, David Daney 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 From: Ganapatrao Kulkarni Enable NUMA balancing for arm64 platforms. Add pte, pmd protnone helpers for use by automatic NUMA balancing. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni Signed-off-by: David Daney --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/pgtable.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7013087..20f5192 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -11,6 +11,7 @@ config ARM64 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_USE_CMPXCHG_LOCKREF select ARCH_SUPPORTS_ATOMIC_RMW + select ARCH_SUPPORTS_NUMA_BALANCING select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_WANT_COMPAT_IPC_PARSE_VERSION select ARCH_WANT_FRAME_POINTERS diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index bf464de..5af9db2 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -346,6 +346,21 @@ static inline pgprot_t mk_sect_prot(pgprot_t prot) return __pgprot(pgprot_val(prot) & ~PTE_TABLE_BIT); } +#ifdef CONFIG_NUMA_BALANCING +/* + * See the comment in include/asm-generic/pgtable.h + */ +static inline int pte_protnone(pte_t pte) +{ + return (pte_val(pte) & (PTE_VALID | PTE_PROT_NONE)) == PTE_PROT_NONE; +} + +static inline int pmd_protnone(pmd_t pmd) +{ + return pte_protnone(pmd_pte(pmd)); +} +#endif + /* * THP definitions. */