From patchwork Tue Feb 2 10:09:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 8187901 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6565DBEEE5 for ; Tue, 2 Feb 2016 10:11:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FDFC202E9 for ; Tue, 2 Feb 2016 10:11:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9370B2025B for ; Tue, 2 Feb 2016 10:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754718AbcBBKLq (ORCPT ); Tue, 2 Feb 2016 05:11:46 -0500 Received: from mail-bn1bon0069.outbound.protection.outlook.com ([157.56.111.69]:50528 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754692AbcBBKLh (ORCPT ); Tue, 2 Feb 2016 05:11:37 -0500 Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none; lists.infradead.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from mypc.cavium.com.com (111.93.218.67) by CY1PR0701MB1696.namprd07.prod.outlook.com (10.163.20.30) with Microsoft SMTP Server (TLS) id 15.1.396.15; Tue, 2 Feb 2016 10:11:21 +0000 From: Ganapatrao Kulkarni To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH v10 6/8] arm64, mm, numa: Adding numa balancing support for arm64. Date: Tue, 2 Feb 2016 15:39:21 +0530 Message-ID: <1454407763-1017-7-git-send-email-gkulkarni@caviumnetworks.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> References: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0067.INDPRD01.PROD.OUTLOOK.COM (25.163.199.39) To CY1PR0701MB1696.namprd07.prod.outlook.com (25.163.20.30) X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1696; 2:9+/1iqGYT8BXErYFc3ZAj6FyLydatE9gRytDbS3QR7a/yUjF7qwXsSVe+EP+WW0tjnKdIdc1aKGGdeyOwRXXnt5PMYK4dU3WiB9eGBcsYJqi+9td7n7BYkbtuA8xZq1T22ccCDqtXUReXvfcFw6QWw==; 3:o41E4acHrezkI2kn2kckbqIpr6IaIXYOWjYmVW2+e6pm2mZEFCbP6OAZ9WXHDsH62xxJSy07RuN8lem7yS/6fmgR+isWwooOlBCHVNNsjSsFEEWh8+wtg672CPDwvbFB; 25:sdohOkdBIUAHadJUXXRFhOhu82g7vIzL5SqHdpcV2R885dv+8lSGVVMrBPJCAUusXXRTj5LxhHCQwvnwyOoLx5gvIhMwVTlJe7eIPdin0A7CO/9j0mOpWEB/t/W9K5OGxI0yZgDv/pAPlAUGiNhuVuykZOV+D2rVTayB9tmgk0dUpx8nEERqa9gPLqx5Ex4JMRLcetI4H9q2zL1kKj0wksE/IZkSDANWQVZvQGdVGf/IR+NuF5onvIBDJIfYdRT0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1696; X-MS-Office365-Filtering-Correlation-Id: 3136b330-91cf-4d60-733b-08d32bb93a3f X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1696; 20:/Xx8IzbwQTzcThRBlfi52k+3XYyFu91G5dSlzx6OT3AiL5ZhqqNkvjtmalrpZCKsf+0OK9j3s2ZzXJQFnWSusFcUgt2NT5Tw+VxRHPhItbTVKFQz09i+bCpBvw4aD1X0vqmDpsY5vWoePHqey5BfSQjQDi+/691QjIDLFr2tBsbro8ZjhROxuhleZN2BGD24+CnPlu6rY14Hg6cGehqhR++Yhq24IhVZM8C5JCdGvPthhvu36ZCCcJPs3Y/lC7gTMItR5krjtSabEq9G0Uvufy9mR0za8ZKS+b9z0O4+oVy+6F3ZNGYR/xGxYgeUioEgjsfOvUugyrLOSVJ/RZrpU7CzgYuFWqlfRPbszJXSK2ctF6XO4ZUzUW3nXxP7AMqt1dgCra0sESFFprdz3IKV+EEqrm+mVmFJVUgh8qm+JvcWcDR2wGa3u/Vrt0P20aErl2LL1QZjxVivBnFNRdsPvEcttdVgxCjvS5atcEF51b22V5Bl0K2yWNLVqRNhOGPPPTvQnPRMbl1KtDkV51zdJLzOUMB7tN4dwkjEkD3OewGStqns3h7DmySR/ZEPCyTr30lXOO9Ot/QDhdPqwPVTl+0dAlfoicjveYCeRgKq3+A= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:CY1PR0701MB1696; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1696; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1696; 4:MxU63cxiXEu6R/YA9BkUz/RE0ULl13Ec9DiioV0jX5yt0/doZqRRoPUkEOYCKwq8z05C2fhLEVHam1KGnYQItCj6bk8s4WH4G44O1YBM6/lZpwVlSbVVNHIbPs3XdqIok4asWnsVBzShSFcn0YOeuglFFim/q69kQUBhS5jXwbUyUyxAMxo5uC5w9oOfS2N/eLu+Zei604Pc4dVZ561jOE3oW0x8DXV5foU8qukUyV6qQmOdS5mgFm4BndpIhikD31JHnSyXepIeiZWSDvtvlZ1gEaQ799eGANsnZ/ZaPS9vpfFfiNrPXnN3CVZMbtMDK8vO9zCVLVRSHBF3YzcUsqhSrl2+xj3jWL5r0HDMmcibHJ9VqsA/vJS99IUEFWe8 X-Forefront-PRVS: 084080FC15 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(87976001)(229853001)(2950100001)(47776003)(189998001)(66066001)(76176999)(42186005)(50226001)(19580405001)(77096005)(5001770100001)(50986999)(4001450100002)(5004730100002)(92566002)(36756003)(586003)(19580395003)(40100003)(5008740100001)(5009440100003)(6116002)(1096002)(3846002)(3470700001)(5003940100001)(2906002)(50466002)(4326007)(33646002)(2441003)(122386002)(48376002)(2201001)(7099028)(921003)(1121003)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1696; H:mypc.cavium.com.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1696; 23:+h4guHDZgMZSqiifulsdfugISgslAc9c7NqiUW0?= =?us-ascii?Q?+N89Dl1/BC5aI7dELNXUwmwt0onKoR/K2q42AfxFDkXOjftYw1/pbgV2LNZB?= =?us-ascii?Q?LdeYMpPuo8nzGLwauhhBwTNFwDMWV8wGL1hMDDzF81psYTbXZAgZbbQBZqoX?= =?us-ascii?Q?s7NWv+Gk36BPrgGB8V/qQ5mtdkGrYL8lUxeykyW1zYyZzP6EI98LJ+Dxg9gW?= =?us-ascii?Q?nnde76TYoxhnbRYV8Cbz055BPv1V310vch2xIujGFGbn0FcnaMdeY/xyygHC?= =?us-ascii?Q?lKsX2ILX3D1Am+UvDH06gi5vK0lyb+EUhWxjwD0YL1l+T2YPX3RsfOyfqtA/?= =?us-ascii?Q?LDidX5Ink7wQHUWvSGuWrH4xeU+m3x910wFVHzqAg42kTfryMDqD/ty4rAeU?= =?us-ascii?Q?JooqgpG+r0Ue2bkGFdgwL2PwnDmCGAkl94dFMRqVqCl5kzLAa6J87jE5yTtX?= =?us-ascii?Q?w6EZ0ygpIN0pFA08bmK6q8Aag/l37dQPjdeP6+mK4o4xuhg8f1ESc17y0Gqi?= =?us-ascii?Q?wpFRQK5HWsFbVWZsAhHZqUqbLAAv72SYpaRp1tE7QLUdkF9yO7jK2lSadJgc?= =?us-ascii?Q?At9NXkKvXgJ1YGd2vkLeKA1aN2rhofxpzFgerIc/e5h6OHHmtKTPhLErtZsa?= =?us-ascii?Q?xXj+jNcpk4cPXH9Z45Q4HP1Qi0gbdiz9GkoeeovenH4IQgDdd4YPBTAwVYSI?= =?us-ascii?Q?8Z8zG4wUDIOHpLYRWQhFDnDEQP0Xs1NUA9q71k2P0OacDh9ijd9e2nFY6ney?= =?us-ascii?Q?Hi7HqgElglSFJzBRe5ulZ8PVeQDPVrMvSFYaB9Um9b1q2YLLx3DDr6NQKiAk?= =?us-ascii?Q?vKO4uWZ6CdK+B8dRVeH1b8p2y2vP67DYMvfx9wMMndOZEymAuO3S+7sOaz1N?= =?us-ascii?Q?IXZQv1FWmkOseC3pSopJsaFDxZS7kZ5i855oPKomdtXpJ3tVfvf1hgwSYrvY?= =?us-ascii?Q?nSNZONz35540OOy5aeneTzpT26zn8OJF3iEppihecyrWboynkApRGzSs5zTz?= =?us-ascii?Q?F7dWpICnzgx312oX5YPCEukYhu+Py+GH4tHTEKtlkCF8X4gZu3VgWFxdTaX0?= =?us-ascii?Q?Bgy/G6caPul//42ogqZgbEvhgJAzV?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1696; 5:W/EW7pfkAyxuqG/LTk5Tax2KuU8c1UMmo+ywAJT9dDo1e8KCG5ln+dHRoABcJkaXIoRgKYDE5Cwnd4wF7j9i8fUtyZtzV1NSM6/ztld4STJBp2aiXCzhpRUx48Z2sW4HuXHdhAlHyUjwuqIah3Bx0w==; 24:pkORzkTbJA3M1m3djkF1dLda3qXPqbiIjbTyaLW4ddB25n5k+5KruB/FlxiDVNWqPnr2s/jq/3J6o2Xo78QedpmR2FPA/m6tW0xfYs5OX0k= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2016 10:11:21.3047 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1696 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 enabled numa balancing for arm64 platforms. added pte, pmd protnone helpers for use by automatic NUMA balancing. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/pgtable.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index fcf3950..8a7c02a 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 if NUMA 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 2d545d7a..24ce546 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -347,6 +347,24 @@ static inline pgprot_t mk_sect_prot(pgprot_t prot) return __pgprot(pgprot_val(prot) & ~PTE_TABLE_BIT); } +#ifdef CONFIG_NUMA_BALANCING + +/* + * These work without NUMA balancing but the kernel does not care. 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 /* CONFIG_NUMA_BALANCING */ + /* * THP definitions. */