OSDN Git Service

mm/memory_hotplug: drop the flags field from struct mhp_restrictions
[tomoyo/tomoyo-test1.git] / include / linux / memory_hotplug.h
index ba0dca6..7c1bcff 100644 (file)
@@ -47,19 +47,21 @@ enum {
 
 /* Types for control the zone type of onlined and offlined memory */
 enum {
-       MMOP_OFFLINE = -1,
-       MMOP_ONLINE_KEEP,
+       /* Offline the memory. */
+       MMOP_OFFLINE = 0,
+       /* Online the memory. Zone depends, see default_zone_for_pfn(). */
+       MMOP_ONLINE,
+       /* Online the memory to ZONE_NORMAL. */
        MMOP_ONLINE_KERNEL,
+       /* Online the memory to ZONE_MOVABLE. */
        MMOP_ONLINE_MOVABLE,
 };
 
 /*
  * Restrictions for the memory hotplug:
- * flags:  MHP_ flags
  * altmap: alternative allocator for memmap array
  */
 struct mhp_restrictions {
-       unsigned long flags;
        struct vmem_altmap *altmap;
 };
 
@@ -94,9 +96,10 @@ extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages);
 extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
 extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
 /* VM interface that may be used by firmware interface */
-extern int online_pages(unsigned long, unsigned long, int);
-extern int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn,
-       unsigned long *valid_start, unsigned long *valid_end);
+extern int online_pages(unsigned long pfn, unsigned long nr_pages,
+                       int online_type, int nid);
+extern struct zone *test_pages_in_a_zone(unsigned long start_pfn,
+                                        unsigned long end_pfn);
 extern unsigned long __offline_isolated_pages(unsigned long start_pfn,
                                                unsigned long end_pfn);
 
@@ -112,7 +115,10 @@ extern int arch_add_memory(int nid, u64 start, u64 size,
                        struct mhp_restrictions *restrictions);
 extern u64 max_mem_size;
 
-extern bool memhp_auto_online;
+extern int memhp_online_type_from_str(const char *str);
+
+/* Default online_type (MMOP_*) when new memory blocks are added. */
+extern int memhp_default_online_type;
 /* If movable_node boot option specified */
 extern bool movable_node_enabled;
 static inline bool movable_node_is_enabled(void)