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: 10735327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9EA591399 for ; Tue, 18 Dec 2018 10:12:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 903442A6AB for ; Tue, 18 Dec 2018 10:12:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DF2F2A7DE; Tue, 18 Dec 2018 10:12:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 275402A7BF for ; Tue, 18 Dec 2018 10:12:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50EEC8E0007; Tue, 18 Dec 2018 05:12:29 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4BE608E0001; Tue, 18 Dec 2018 05:12:29 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3AE8F8E0007; Tue, 18 Dec 2018 05:12:29 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by kanga.kvack.org (Postfix) with ESMTP id 100008E0001 for ; Tue, 18 Dec 2018 05:12:29 -0500 (EST) Received: by mail-ot1-f70.google.com with SMTP id z22so9093501oto.11 for ; Tue, 18 Dec 2018 02:12:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=oGk4fwEb+SgvTOQQvpKpD/N8WsjuZ/+riYPphBaU9zs=; b=cyPCFfkRvrE6o41smNttoLJbkBdL36xnYRqOW+IDUU3BMWPGNvQXaBOdDpkhQXWt/v fx/MRpZPStd1W2sIWm3jc8ifrhLrLc1WRRotHrKJIq1JGGk4RHLQO2STHxTzW7Qe4lid 8G0P8xbEW5gZlyI/gsaRu7P4VcAZ2k2YeiUpqIbK8rNr+f3tv8NLuNF0YRYCv2flnKEf 75eBMl5jzUQl9/tl/P/vAxAbGeyxAKvTkZd3fOPGnewM67yYTjy5JRIlZRYwxHUY6/Ay 3ZZUwR8Ijh4uv2RsAPzBUPDl4b68dGUgnhAlF05nzMk3IFGehfTrpnRLgy8staFvA+2q HAaQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Gm-Message-State: AA+aEWZgeGCNE3jcTEjyTKkUKw4rJ0kyvCb5Uij5mWpmW5HUWWA39M/g vUq664KDh1gvX1N4YDTaTXsid8rxvp9BxWtFnKt5qd0QdkpPuTzOjahHrdpgSsRNQ5courQrFug Hkv3cXX+m7ko9TtrqbGHbcSb4Y7D9XdS8z0VM5g4bWtn42Xfnnx8mfSj/uq3Eu2QDKg== X-Received: by 2002:aca:ac13:: with SMTP id v19mr7158369oie.160.1545127948810; Tue, 18 Dec 2018 02:12:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/WnZFzYAVArTNFumNoqTyJJe3QqzXnuftylZPViGlGiUS4MMeNhTTVyNfmTdtGCyE/T+Eax X-Received: by 2002:aca:ac13:: with SMTP id v19mr7158351oie.160.1545127948038; Tue, 18 Dec 2018 02:12:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545127948; cv=none; d=google.com; s=arc-20160816; b=yZlqxTar6pit1msWif8295O7EPDoS+C1fHD1sKtX+itEd7E7t8ntjxtuI+gZsnx4Vv jzP0NQXNP7evuR9rP84cxf4udPrFyFXDmc96NPWe99WOuENxFlPuwoppCSSagQHsDHDR 41OPUus7WwTQnrXoOD3Rg6Hv/hwcyON7OuHoBzzsRjmx5p0OiejdFKsEBubKx8ZHEB3L DsD1ehZT5deqlWAgVA2gQVs/DB4TKlzEtPveCWFAhzqC8RCMCMWT/X2M0duaCwOUlcJI Qd7MUB01YercnjBXELxAGaBpBRKvciZCR0AErJVhooF3PQEFDa8mRmIxaM8zl83U7X6g 7WcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=oGk4fwEb+SgvTOQQvpKpD/N8WsjuZ/+riYPphBaU9zs=; b=jIUWRnT0ybmxyWkexzXyw3P1eQh+LyQCcsf3y2/1Uls68O3HtA1va8sUdb86p8wPYX hkPhX0fGDLdFsP/BwiO0ramIZMdcDcSVzSc/7c1c5vBGA6tlxl15W2+FqU9BSRRVNo9f t64ClVu2OR1y/jq8dqyxLheMxNKtTFg/If8h6H4RdxS6fXiK0O3wePxX1uAipXSEwfou iv3IleLJ8K412tD0M9QIvho0wWp0gmLxLpAimOXr/e3/EVfYI4Sfq+lqpKi0LPXitgjQ fddNEVQJOb1Hd8H131IbSunEn9vQ+kz/lrJrJzx0tGi1JlDYRT59vzI67UIRms73pw7+ JryQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id 7si7554188otp.23.2018.12.18.02.12.27 for ; Tue, 18 Dec 2018 02:12:27 -0800 (PST) Received-SPF: pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com 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 Cc: ocfs2-devel@oss.oracle.com, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-media@vger.kernel.org, iommu@lists.linux-foundation.org, linux-rdma@vger.kernel.org, dmaengine@vger.kernel.org, linux-block@vger.kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-ia64@vger.kernel.org, linux-alpha@vger.kernel.org, akpm@linux-foundation.org, jiangqi903@gmail.com, hverkuil@xs4all.nl, vkoul@kernel.org, sfr@canb.auug.org.au, dledford@redhat.com, mpe@ellerman.id.au, axboe@kernel.dk, jeffrey.t.kirsher@intel.com, david@redhat.com 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-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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);