Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c9eefe8 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds
Browse files

tools/: replace open encodings for NUMA_NO_NODE

This replaces all open encodings in tools with NUMA_NO_NODE.  Also
linux/numa.h is now needed for the perf build.

[sfr@canb.auug.org.au: fix for replace open encodings for NUMA_NO_NODE]
  Link: http://lkml.kernel.org/r/20190108131141.730e9c4f@canb.auug.org.au
Link: http://lkml.kernel.org/r/1545127933-10711-3-git-send-email-anshuman.khandual@arm.com


Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Cc: David Hildenbrand <david@redhat.com>
Cc: Doug Ledford <dledford@redhat.com>		[drivers/infiniband]
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>	[ixgbe]
Cc: Jens Axboe <axboe@kernel.dk>			[mtip32xx]
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>		[powerpc]
Cc: Vinod Koul <vkoul@kernel.org>			[dmaengine.c]
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 98fa15f3
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
/* 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 */
+4 −3
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include <sys/types.h>
#include <linux/kernel.h>
#include <linux/time64.h>
#include <linux/numa.h>

#include <numa.h>
#include <numaif.h>
@@ -298,7 +299,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 +340,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 +1364,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);