From patchwork Tue Dec 18 10:12:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 1015256 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43JvDS6mwZz9sC7 for ; Tue, 18 Dec 2018 21:20:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43JvDS4TQ9zDqSw for ; Tue, 18 Dec 2018 21:20:40 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=arm.com (client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=anshuman.khandual@arm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by lists.ozlabs.org (Postfix) with ESMTP id 43Jv311qJ2zDqRh for ; Tue, 18 Dec 2018 21:12:29 +1100 (AEDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8C8E8A78; Tue, 18 Dec 2018 02:12:27 -0800 (PST) Received: from p8cg001049571a15.blr.arm.com (p8cg001049571a15.blr.arm.com [10.162.41.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 55F803F5C0; Tue, 18 Dec 2018 02:12:19 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 2/2] Tools: Replace open encodings for NUMA_NO_NODE Date: Tue, 18 Dec 2018 15:42:13 +0530 Message-Id: <1545127933-10711-3-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545127933-10711-1-git-send-email-anshuman.khandual@arm.com> References: <1545127933-10711-1-git-send-email-anshuman.khandual@arm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, linux-ia64@vger.kernel.org, david@redhat.com, dri-devel@lists.freedesktop.org, hverkuil@xs4all.nl, sparclinux@vger.kernel.org, sfr@canb.auug.org.au, linux-rdma@vger.kernel.org, iommu@lists.linux-foundation.org, dledford@redhat.com, intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com, jiangqi903@gmail.com, linux-media@vger.kernel.org, linux-block@vger.kernel.org, axboe@kernel.dk, netdev@vger.kernel.org, vkoul@kernel.org, linux-alpha@vger.kernel.org, dmaengine@vger.kernel.org, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Stephen Rothwell This replaces all open encodings in tools with NUMA_NO_NODE. Also linux/numa.h is now needed for the perf build. Signed-off-by: Anshuman Khandual Signed-off-by: Stephen Rothwell --- tools/include/linux/numa.h | 16 ++++++++++++++++ tools/perf/bench/numa.c | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 tools/include/linux/numa.h diff --git a/tools/include/linux/numa.h b/tools/include/linux/numa.h new file mode 100644 index 0000000..110b0e5 --- /dev/null +++ b/tools/include/linux/numa.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_NUMA_H +#define _LINUX_NUMA_H + + +#ifdef CONFIG_NODES_SHIFT +#define NODES_SHIFT CONFIG_NODES_SHIFT +#else +#define NODES_SHIFT 0 +#endif + +#define MAX_NUMNODES (1 << NODES_SHIFT) + +#define NUMA_NO_NODE (-1) + +#endif /* _LINUX_NUMA_H */ diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index 4419551..e0ad5f1 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -298,7 +298,7 @@ static cpu_set_t bind_to_node(int target_node) CPU_ZERO(&mask); - if (target_node == -1) { + if (target_node == NUMA_NO_NODE) { for (cpu = 0; cpu < g->p.nr_cpus; cpu++) CPU_SET(cpu, &mask); } else { @@ -339,7 +339,7 @@ static void bind_to_memnode(int node) unsigned long nodemask; int ret; - if (node == -1) + if (node == NUMA_NO_NODE) return; BUG_ON(g->p.nr_nodes > (int)sizeof(nodemask)*8); @@ -1363,7 +1363,7 @@ static void init_thread_data(void) int cpu; /* Allow all nodes by default: */ - td->bind_node = -1; + td->bind_node = NUMA_NO_NODE; /* Allow all CPUs by default: */ CPU_ZERO(&td->bind_cpumask);