From patchwork Thu Mar 3 23:55:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 8497151 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 E1BB79F38C for ; Thu, 3 Mar 2016 23:58:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF6552010F for ; Thu, 3 Mar 2016 23:58:34 +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 1F8842026F for ; Thu, 3 Mar 2016 23:58:34 +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 1abd79-0007B2-Tn; Thu, 03 Mar 2016 23:57:03 +0000 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1abd6K-0006eJ-Gp for linux-arm-kernel@lists.infradead.org; Thu, 03 Mar 2016 23:56:14 +0000 Received: by mail-pa0-x243.google.com with SMTP id fl4so2074881pad.2 for ; Thu, 03 Mar 2016 15:55:51 -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=lKqMx+iDVRBdwOWpM37ATWkMJPK93nkVVopec4KEGm+Q+tn/ns3xtnvgWurEXS70yt zF59+kFjKb9RSHtEzoWHed6tI9KccRD3ydPn6teZGHU0oIn3W6bV/CIa/Z3r0GeWh8ku l/De4K1UDsr5Wk9OPu/wuwxw6S/SBTAt6UaxIUuG+5DUB/Cpmf6xsTau1VAD4jJgQPu1 HIKnOkyuhwGo7pBmsf2N86IQ7XtnYVr413khzIkVXihp0cK8JByIpkiYx5SB3IlTLP7k QWDv6KYl4YBrDwFK1YdWzwhxwHhj1PwYftBhLsvEzyVGyiDeWdvVvkfvySrpvdyN7XaC 7mFQ== 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=m26/Sbgz1XuFFNyQnJor/4qx0AjPfvhpIqMW8Lhwk7q6KcbIGZfzYVrw0zOBzqgDMp 1vn5i2R17Ags3iNSWqw928AeZi8ICTEJWi2y8c6eex1PAAfWkAfgOzQo3heIFj8nhMku enBZlJ7ZBaDmI39Z+9lcXdkdLrycsRH8d37V9hbTtLWnAvwsDPcwBUeAIxJUJuW9j/CB rQxaFs+zQ6u9ufLCrlJ06uSg6FKyxUZxk/kiLXoM05ZRSNMDMKF5CC0HMzPuUNJ7NWPM E2F6LwOwdXisgCzkpEby2aP/K3mYOR93SkiBROEJDt0dllY+o6GLBckSYwDSQ9IrAkZ8 JK7A== X-Gm-Message-State: AD7BkJINN1OtA9+BDpdC+E9bBFGbsJe60BuonsDFlUEEgbJ+bBu8YJyq+5miua+R2X+01g== X-Received: by 10.67.3.67 with SMTP id bu3mr7598091pad.39.1457049351529; Thu, 03 Mar 2016 15:55:51 -0800 (PST) Received: from dl.caveonetworks.com ([64.2.3.194]) by smtp.gmail.com with ESMTPSA id e1sm702252pas.1.2016.03.03.15.55.44 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 03 Mar 2016 15:55:46 -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 u23NthWK023415; Thu, 3 Mar 2016 15:55:43 -0800 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u23Nth1L023414; Thu, 3 Mar 2016 15:55:43 -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 v14 6/6] arm64, mm, numa: Add NUMA balancing support for arm64. Date: Thu, 3 Mar 2016 15:55:39 -0800 Message-Id: <1457049339-23351-7-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1457049339-23351-1-git-send-email-ddaney.cavm@gmail.com> References: <1457049339-23351-1-git-send-email-ddaney.cavm@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160303_155612_755274_6806B1F4 X-CRM114-Status: GOOD ( 12.50 ) 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. */