--- v8
+++ 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 5f9f8c7..d85af6d 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;
++ 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;
++ page->lru.next = (struct list_head *)type;
+ SetPagePrivate(page);
+ set_page_private(page, info);
+ atomic_inc(&page->_count);