aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorAnshuman Khandual <anshuman.khandual@arm.com>2019-03-05 18:42:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-06 00:07:14 -0500
commit98fa15f34cb379864757670b8e8743b21456a20e (patch)
tree18a360dd850e9a5d67db7a0700f0b3a82a3f8e2b /mm/page_alloc.c
parent6ade20327dbb808882888ed8ccded71e93067cf9 (diff)
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>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5361bd078493..1f9f1409df9b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6016,7 +6016,7 @@ int __meminit __early_pfn_to_nid(unsigned long pfn,
6016 return state->last_nid; 6016 return state->last_nid;
6017 6017
6018 nid = memblock_search_pfn_nid(pfn, &start_pfn, &end_pfn); 6018 nid = memblock_search_pfn_nid(pfn, &start_pfn, &end_pfn);
6019 if (nid != -1) { 6019 if (nid != NUMA_NO_NODE) {
6020 state->last_start = start_pfn; 6020 state->last_start = start_pfn;
6021 state->last_end = end_pfn; 6021 state->last_end = end_pfn;
6022 state->last_nid = nid; 6022 state->last_nid = nid;
@@ -6771,7 +6771,7 @@ unsigned long __init node_map_pfn_alignment(void)
6771{ 6771{
6772 unsigned long accl_mask = 0, last_end = 0; 6772 unsigned long accl_mask = 0, last_end = 0;
6773 unsigned long start, end, mask; 6773 unsigned long start, end, mask;
6774 int last_nid = -1; 6774 int last_nid = NUMA_NO_NODE;
6775 int i, nid; 6775 int i, nid;
6776 6776
6777 for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, &nid) { 6777 for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, &nid) {