mm: replace all open encodings for NUMA_NO_NODE
Patch series "Replace all open encodings for NUMA_NO_NODE", v3. All these places for replacement were found by running the following grep patterns on the entire kernel code. Please let me know if this might have missed some instances. This might also have replaced some false positives. I will appreciate suggestions, inputs and review. 1. git grep "nid == -1" 2. git grep "node == -1" 3. git grep "nid = -1" 4. git grep "node = -1" This patch (of 2): At present there are multiple places where invalid node number is encoded as -1. Even though implicitly understood it is always better to have macros in there. Replace these open encodings for an invalid node number with the global macro NUMA_NO_NODE. This helps remove NUMA related assumptions like 'invalid node' from various places redirecting them to a common definition. Link: http://lkml.kernel.org/r/1545127933-10711-2-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Reviewed-by: David Hildenbrand <david@redhat.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> [ixgbe] Acked-by: Jens Axboe <axboe@kernel.dk> [mtip32xx] Acked-by: Vinod Koul <vkoul@kernel.org> [dmaengine.c] Acked-by: Michael Ellerman <mpe@ellerman.id.au> [powerpc] Acked-by: Doug Ledford <dledford@redhat.com> [drivers/infiniband] Cc: Joseph Qi <jiangqi903@gmail.com> Cc: Hans Verkuil <hverkuil@xs4all.nl> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
6ade20327d
commit
98fa15f34c
@@ -27,6 +27,7 @@
|
||||
#include <linux/crash_dump.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/memory.h>
|
||||
#include <linux/numa.h>
|
||||
|
||||
#include <asm/uv/uv_mmrs.h>
|
||||
#include <asm/uv/uv_hub.h>
|
||||
@@ -1390,7 +1391,7 @@ static void __init build_socket_tables(void)
|
||||
}
|
||||
|
||||
/* Set socket -> node values: */
|
||||
lnid = -1;
|
||||
lnid = NUMA_NO_NODE;
|
||||
for_each_present_cpu(cpu) {
|
||||
int nid = cpu_to_node(cpu);
|
||||
int apicid, sockid;
|
||||
@@ -1521,7 +1522,7 @@ static void __init uv_system_init_hub(void)
|
||||
new_hub->pnode = 0xffff;
|
||||
|
||||
new_hub->numa_blade_id = uv_node_to_blade_id(nodeid);
|
||||
new_hub->memory_nid = -1;
|
||||
new_hub->memory_nid = NUMA_NO_NODE;
|
||||
new_hub->nr_possible_cpus = 0;
|
||||
new_hub->nr_online_cpus = 0;
|
||||
}
|
||||
@@ -1538,7 +1539,7 @@ static void __init uv_system_init_hub(void)
|
||||
|
||||
uv_cpu_info_per(cpu)->p_uv_hub_info = uv_hub_info_list(nodeid);
|
||||
uv_cpu_info_per(cpu)->blade_cpu_id = uv_cpu_hub_info(cpu)->nr_possible_cpus++;
|
||||
if (uv_cpu_hub_info(cpu)->memory_nid == -1)
|
||||
if (uv_cpu_hub_info(cpu)->memory_nid == NUMA_NO_NODE)
|
||||
uv_cpu_hub_info(cpu)->memory_nid = cpu_to_node(cpu);
|
||||
|
||||
/* Init memoryless node: */
|
||||
|
@@ -56,6 +56,7 @@
|
||||
#include <linux/stackprotector.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/cpuidle.h>
|
||||
#include <linux/numa.h>
|
||||
|
||||
#include <asm/acpi.h>
|
||||
#include <asm/desc.h>
|
||||
@@ -841,7 +842,7 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
|
||||
/* reduce the number of lines printed when booting a large cpu count system */
|
||||
static void announce_cpu(int cpu, int apicid)
|
||||
{
|
||||
static int current_node = -1;
|
||||
static int current_node = NUMA_NO_NODE;
|
||||
int node = early_cpu_to_node(cpu);
|
||||
static int width, node_width;
|
||||
|
||||
|
Reference in New Issue
Block a user