diff options
author | Wei Yang <weiyang@linux.vnet.ibm.com> | 2015-09-08 17:59:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-08 18:35:28 -0400 |
commit | 904a9553d4fcdc0c7d5621f6178f0e07598701dc (patch) | |
tree | 2dd0acd4856e1365c3abb47ff7da700200e29279 /mm/page_alloc.c | |
parent | 52a2b53ffde6d6018dfc454fbde34383351fb896 (diff) |
mm/page_alloc.c: refine the calculation of highest possible node id
nr_node_ids records the highest possible node id, which is calculated by
scanning the bitmap node_states[N_POSSIBLE]. Current implementation
scan the bitmap from the beginning, which will scan the whole bitmap.
This patch reverses the order by scanning from the end with
find_last_bit().
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
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.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5b5240b7f642..809e27e77b3a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5478,11 +5478,9 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size, | |||
5478 | */ | 5478 | */ |
5479 | void __init setup_nr_node_ids(void) | 5479 | void __init setup_nr_node_ids(void) |
5480 | { | 5480 | { |
5481 | unsigned int node; | 5481 | unsigned int highest; |
5482 | unsigned int highest = 0; | ||
5483 | 5482 | ||
5484 | for_each_node_mask(node, node_possible_map) | 5483 | highest = find_last_bit(node_possible_map.bits, MAX_NUMNODES); |
5485 | highest = node; | ||
5486 | nr_node_ids = highest + 1; | 5484 | nr_node_ids = highest + 1; |
5487 | } | 5485 | } |
5488 | #endif | 5486 | #endif |