I plan to fold the following into this patch.
---
>From 2cdb8e398eaeddf8b743bddb421dc5d9e49e442d Mon Sep 17 00:00:00 2001
From: Michal Hocko <mho...@suse.com>
Date: Thu, 27 Apr 2017 09:53:01 +0200
Subject: [PATCH] fold me "mm: consider zone which is not fully populated to
 have holes"

- clarify pfn_valid semantic - requested by Joonsoo
---
 include/linux/mmzone.h | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index aa8cc03287b0..f8c9453635e5 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1268,10 +1268,15 @@ unsigned long __init node_memmap_size_bytes(int, 
unsigned long, unsigned long);
 #ifdef CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
 /*
  * pfn_valid() is meant to be able to tell if a given PFN has valid memmap
- * associated with it or not. In FLATMEM, it is expected that holes always
- * have valid memmap as long as there is valid PFNs either side of the hole.
- * In SPARSEMEM, it is assumed that a valid section has a memmap for the
- * entire section.
+ * associated with it or not. This means that a struct page exists for this
+ * pfn. The caller cannot assume the page is fully initialized in general.
+ * Hotplugable pages might not have been onlined yet. pfn_to_online_page()
+ * will ensure the struct page is fully online and initialized. Special pages
+ * (e.g. ZONE_DEVICE) are never onlined and should be treated accordingly.
+ *
+ * In FLATMEM, it is expected that holes always have valid memmap as long as
+ * there is valid PFNs either side of the hole. In SPARSEMEM, it is assumed
+ * that a valid section has a memmap for the entire section.
  *
  * However, an ARM, and maybe other embedded architectures in the future
  * free memmap backing holes to save memory on the assumption the memmap is
-- 
2.11.0

-- 
Michal Hocko
SUSE Labs

Reply via email to