]> git.karo-electronics.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>
Wed, 17 Oct 2012 02:06:05 +0000 (13:06 +1100)
commit0461cec9705f575f02c3a391b0884eb7badd1796
tree1446f5540c2a8b4f50ca18e28e9e673ec273a139
parent0e429d44282f2c1d31e865b0e9e98796774914b7
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