mm/page_alloc.c: refine the calculation of highest possible node id
authorWei Yang <[email protected]>
Tue, 8 Sep 2015 21:59:48 +0000 (14:59 -0700)
committerLinus Torvalds <[email protected]>
Tue, 8 Sep 2015 22:35:28 +0000 (15:35 -0700)
commit904a9553d4fcdc0c7d5621f6178f0e07598701dc
tree2dd0acd4856e1365c3abb47ff7da700200e29279
parent52a2b53ffde6d6018dfc454fbde34383351fb896
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 <[email protected]>
Cc: Tejun Heo <[email protected]>
Acked-by: David Rientjes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/page_alloc.c