]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mm/memblock: reduce overhead in binary search
authorWanpeng Li <liwanp@linux.vnet.ibm.com>
Fri, 12 Oct 2012 04:22:58 +0000 (15:22 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 22 Oct 2012 04:01:08 +0000 (15:01 +1100)
commit0777c64ea0988e0b8261a073e6725381154c828e
tree597c7b0376bfa0dc82427363c33b7d17a4402954
parentff72afc988e5baa3802a9ac38271e5a34049719a
mm/memblock: reduce overhead in binary search

When checking that the indicated address belongs to the memory region, the
memory regions are checked one by one through a binary search, which will
be time consuming.

If the indicated address isn't in the memory region, then we needn't do
the time-consuming search.  Add a check on the indicated address for that
purpose.

Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memblock.c