]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/page_ext.c
mm/page_poisoning.c: allow for zero poisoning
[mirror_ubuntu-zesty-kernel.git] / mm / page_ext.c
index 292ca7b8debd2c27c87d056e1ea4872d3094c756..2d864e64f7fe3d4128e4cf043a3d0b93374bcfea 100644 (file)
@@ -106,12 +106,15 @@ struct page_ext *lookup_page_ext(struct page *page)
        struct page_ext *base;
 
        base = NODE_DATA(page_to_nid(page))->node_page_ext;
-#ifdef CONFIG_DEBUG_VM
+#if defined(CONFIG_DEBUG_VM) || defined(CONFIG_PAGE_POISONING)
        /*
         * The sanity checks the page allocator does upon freeing a
         * page can reach here before the page_ext arrays are
         * allocated when feeding a range of pages to the allocator
         * for the first time during bootup or memory hotplug.
+        *
+        * This check is also necessary for ensuring page poisoning
+        * works as expected when enabled
         */
        if (unlikely(!base))
                return NULL;
@@ -180,12 +183,15 @@ struct page_ext *lookup_page_ext(struct page *page)
 {
        unsigned long pfn = page_to_pfn(page);
        struct mem_section *section = __pfn_to_section(pfn);
-#ifdef CONFIG_DEBUG_VM
+#if defined(CONFIG_DEBUG_VM) || defined(CONFIG_PAGE_POISONING)
        /*
         * The sanity checks the page allocator does upon freeing a
         * page can reach here before the page_ext arrays are
         * allocated when feeding a range of pages to the allocator
         * for the first time during bootup or memory hotplug.
+        *
+        * This check is also necessary for ensuring page poisoning
+        * works as expected when enabled
         */
        if (!section->page_ext)
                return NULL;