mm/page_alloc.c: broken deferred calculation
[sfrench/cifs-2.6.git] / include / linux / mmzone.h
index c8f89417740bb5819bc9cb2b81549e31a4af4fc0..67f2e3c389396c232a8d30b930ec18d6235f7c64 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef _LINUX_MMZONE_H
 #define _LINUX_MMZONE_H
 
@@ -699,7 +700,8 @@ typedef struct pglist_data {
         * is the first PFN that needs to be initialised.
         */
        unsigned long first_deferred_pfn;
-       unsigned long static_init_size;
+       /* Number of non-deferred pages */
+       unsigned long static_init_pgcnt;
 #endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -711,12 +713,6 @@ typedef struct pglist_data {
        /* Fields commonly accessed by the page reclaim scanner */
        struct lruvec           lruvec;
 
-       /*
-        * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on
-        * this node's LRU.  Maintained by the pageout code.
-        */
-       unsigned int inactive_ratio;
-
        unsigned long           flags;
 
        ZONE_PADDING(_pad2_)
@@ -1150,13 +1146,17 @@ struct mem_section {
 #define SECTION_ROOT_MASK      (SECTIONS_PER_ROOT - 1)
 
 #ifdef CONFIG_SPARSEMEM_EXTREME
-extern struct mem_section *mem_section[NR_SECTION_ROOTS];
+extern struct mem_section **mem_section;
 #else
 extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT];
 #endif
 
 static inline struct mem_section *__nr_to_section(unsigned long nr)
 {
+#ifdef CONFIG_SPARSEMEM_EXTREME
+       if (!mem_section)
+               return NULL;
+#endif
        if (!mem_section[SECTION_NR_TO_ROOT(nr)])
                return NULL;
        return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK];