All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-memblock-reduce-overhead-in-binary-search.patch added to -mm tree
@ 2012-09-07 23:50 akpm
  2012-09-10  8:22   ` Michal Hocko
  0 siblings, 1 reply; 16+ messages in thread
From: akpm @ 2012-09-07 23:50 UTC (permalink / raw)
  To: mm-commits; +Cc: liwanp, kamezawa.hiroyu, mhocko, minchan, shangw, yinghai


The patch titled
     Subject: mm/memblock: reduce overhead in binary search
has been added to the -mm tree.  Its filename is
     mm-memblock-reduce-overhead-in-binary-search.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Subject: 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 |    5 +++++
 1 file changed, 5 insertions(+)

diff -puN mm/memblock.c~mm-memblock-reduce-overhead-in-binary-search mm/memblock.c
--- a/mm/memblock.c~mm-memblock-reduce-overhead-in-binary-search
+++ a/mm/memblock.c
@@ -888,6 +888,11 @@ int __init memblock_is_reserved(phys_add
 
 int __init_memblock memblock_is_memory(phys_addr_t addr)
 {
+
+	if (unlikely(addr < memblock_start_of_DRAM() ||
+		addr >= memblock_end_of_DRAM()))
+		return 0;
+
 	return memblock_search(&memblock.memory, addr) != -1;
 }
 
_

Patches currently in -mm which might be from liwanp@linux.vnet.ibm.com are

mm-mmu_notifier-init-notifier-if-necessary.patch
mm-vmscan-fix-error-number-for-failed-kthread.patch
mm-memblock-reduce-overhead-in-binary-search.patch
mm-memblock-rename-get_allocated_memblock_reserved_regions_info.patch
mm-memblock-use-existing-interface-to-set-nid.patch
mm-memblock-cleanup-early_node_map-related-comments.patch


^ permalink raw reply	[flat|nested] 16+ messages in thread
* + mm-memblock-reduce-overhead-in-binary-search.patch added to -mm tree
@ 2012-08-24 21:48 akpm
  0 siblings, 0 replies; 16+ messages in thread
From: akpm @ 2012-08-24 21:48 UTC (permalink / raw)
  To: mm-commits
  Cc: liwanp, benh, kamezawa.hiroyu, mhocko, minchan, shangw, yinghai


The patch titled
     Subject: mm/memblock: reduce overhead in binary search
has been added to the -mm tree.  Its filename is
     mm-memblock-reduce-overhead-in-binary-search.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Subject: mm/memblock: reduce overhead in binary search

When checking the indicated address belongs to the memory or reserved
region, the memory or reserved regions are checked one by one through
binary search, which would be a little time consuming.  If the indicated
address isn't in memory region, then we needn't do the time-sonsuming
search.  The patch adds more 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>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memblock.c |    4 ++++
 1 file changed, 4 insertions(+)

diff -puN mm/memblock.c~mm-memblock-reduce-overhead-in-binary-search mm/memblock.c
--- a/mm/memblock.c~mm-memblock-reduce-overhead-in-binary-search
+++ a/mm/memblock.c
@@ -871,6 +871,10 @@ static int __init_memblock memblock_sear
 {
 	unsigned int left = 0, right = type->cnt;
 
+	if (unlikely(addr < memblock_start_of_DRAM() ||
+		addr >= memblock_end_of_DRAM()))
+			return 0;
+
 	do {
 		unsigned int mid = (right + left) / 2;
 
_

Patches currently in -mm which might be from liwanp@linux.vnet.ibm.com are

mm-memblock-truncate-memblock-if-necessary.patch
mm-memblock-rename-get_allocated_memblock_reserved_regions_info.patch
mm-memblock-reduce-overhead-in-binary-search.patch
mm-memblock-use-existing-interface-to-set-nid.patch
mm-memblock-cleanup-early_node_map-related-comments.patch


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-12-18 23:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07 23:50 + mm-memblock-reduce-overhead-in-binary-search.patch added to -mm tree akpm
2012-09-10  8:22 ` Michal Hocko
2012-09-10  8:22   ` Michal Hocko
2012-09-10  9:46   ` Wanpeng Li
2012-09-10 11:05     ` Michal Hocko
2012-09-10 11:05       ` Michal Hocko
2012-09-10 11:30       ` Wanpeng Li
2012-09-10 11:30       ` Wanpeng Li
2012-09-10 11:55         ` Michal Hocko
2012-09-10 11:55           ` Michal Hocko
2012-10-08 19:42           ` Andrew Morton
2012-10-08 19:42             ` Andrew Morton
2012-12-18 23:11             ` Andrew Morton
2012-12-18 23:11               ` Andrew Morton
2012-09-10  9:46   ` Wanpeng Li
  -- strict thread matches above, loose matches on Subject: below --
2012-08-24 21:48 akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.