Inter-revision diff: patch 13

Comparing v5 (message) to v9 (message)

--- v5
+++ v9
@@ -1,8 +1,10 @@
 From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
 
-There is a possibility that get_page_bootmem() is called to the same page many
-times. So when get_page_bootmem is called to the same page, the function only
-increments page->_count.
+The function get_page_bootmem() may be called more than one time to the same
+page. There is no need to set page's type, private if the function is not
+the first time called to the page.
+
+Note: the patch is just optimization and does not fix any problem.
 
 CC: David Rientjes <rientjes@google.com>
 CC: Jiang Liu <liuj97@gmail.com>
@@ -20,7 +22,7 @@
  1 files changed, 11 insertions(+), 4 deletions(-)
 
 diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
-index 0c932e1..eae946b 100644
+index d736df3..26a5012 100644
 --- a/mm/memory_hotplug.c
 +++ b/mm/memory_hotplug.c
 @@ -95,10 +95,17 @@ static void release_memory_resource(struct resource *res)
@@ -33,10 +35,10 @@
 -	atomic_inc(&page->_count);
 +	unsigned long page_type;
 +
-+	page_type = (unsigned long) page->lru.next;
-+	if (type < MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE ||
-+	    type > MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE){
-+		page->lru.next = (struct list_head *) type;
++	page_type = (unsigned long)page->lru.next;
++	if (page_type < MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE ||
++	    page_type > MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE){
++		page->lru.next = (struct list_head *)type;
 +		SetPagePrivate(page);
 +		set_page_private(page, info);
 +		atomic_inc(&page->_count);
@@ -47,3 +49,9 @@
  /* reference to __meminit __free_pages_bootmem is valid
 -- 
 1.7.1
+
+--
+To unsubscribe, send a message with 'unsubscribe linux-mm' in
+the body to majordomo@kvack.org.  For more info on Linux MM,
+see: http://www.linux-mm.org/ .
+Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help