[PATCH 2/4] mm: not __SetPageReserved on initializing hot-plugged memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Initialize all pages reserved is an ancient behavior.

Since commit 92923ca3aace ("mm: meminit: only set page reserved in the
memblock region"), SetPageReserved is removed from
__init_single_page(). Only those reserved pages are marked PG_reserved.

But we still set PG_reserved on offline and check it on online.

Following two commits removed both of them:

* Commit 0ee5f4f31d36 ("mm/page_alloc.c: don't set pages PageReserved()
  when offlining") removed the set on offline.
* Commit 5ecae6359e3a ("mm/memory_hotplug: drop PageReserved() check in
  online_pages_range()") removed the check on online.

This means we set PG_reserved for hot-plugged memory at initialization
is not helpful and a little different from bootmem initialization path.
Now we can remove it.

Memory hot-add and hot-remove have been tested.

Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
CC: Nathan Zimmer <nzimmer@xxxxxxx>
CC: David Hildenbrand <david@xxxxxxxxxx>
CC: Mike Rapoport (IBM) <rppt@xxxxxxxxxx>
---
 mm/mm_init.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mm/mm_init.c b/mm/mm_init.c
index 3ec04933f7fd..362ac4334b99 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -839,9 +839,8 @@ static void __init init_unavailable_range(unsigned long spfn,
 }
 
 /*
- * Initially all pages are reserved - free ones are freed
- * up by memblock_free_all() once the early boot process is
- * done. Non-atomic initialization, single-pass.
+ * Free ones are freed up by memblock_free_all() once the early boot process
+ * is done. Non-atomic initialization, single-pass.
  *
  * All aligned pageblocks are initialized to the specified migratetype
  * (usually MIGRATE_MOVABLE). Besides setting the migratetype, no related
@@ -892,8 +891,6 @@ void __meminit memmap_init_range(unsigned long size, int nid, unsigned long zone
 
 		page = pfn_to_page(pfn);
 		__init_single_page(page, pfn, zone, nid);
-		if (context == MEMINIT_HOTPLUG)
-			__SetPageReserved(page);
 
 		/*
 		 * Usually, we want to mark the pageblock MIGRATE_MOVABLE,
-- 
2.34.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux