]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/memblock: reduce overhead in binary search
authorWanpeng Li <liwanp@linux.vnet.ibm.com>
Thu, 29 Nov 2012 03:18:14 +0000 (14:18 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2012 05:23:24 +0000 (16:23 +1100)
commit33f472774743cd822929bc308bb78b2a0f4ff6f5
tree73d4d3dbd830e4fb8cc9a93637af3d1f7ff8b317
parent1a2b5852b2aa0842dfd7226ac49c97128eb89aea
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