]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/page_alloc.c
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[karo-tx-linux.git] / mm / page_alloc.c
index 42cf199652a530aec9f7c508cc91ba1890514342..a762be57e46e14efa571b967eb75696c35ebd034 100644 (file)
@@ -308,13 +308,20 @@ static inline bool update_defer_init(pg_data_t *pgdat,
                                unsigned long pfn, unsigned long zone_end,
                                unsigned long *nr_initialised)
 {
+       unsigned long max_initialise;
+
        /* Always populate low zones for address-contrained allocations */
        if (zone_end < pgdat_end_pfn(pgdat))
                return true;
+       /*
+        * Initialise at least 2G of a node but also take into account that
+        * two large system hashes that can take up 1GB for 0.25TB/node.
+        */
+       max_initialise = max(2UL << (30 - PAGE_SHIFT),
+               (pgdat->node_spanned_pages >> 8));
 
-       /* Initialise at least 2G of the highest zone */
        (*nr_initialised)++;
-       if (*nr_initialised > (2UL << (30 - PAGE_SHIFT)) &&
+       if ((*nr_initialised > max_initialise) &&
            (pfn & (PAGES_PER_SECTION - 1)) == 0) {
                pgdat->first_deferred_pfn = pfn;
                return false;
@@ -544,11 +551,11 @@ static int __init debug_guardpage_minorder_setup(char *buf)
        unsigned long res;
 
        if (kstrtoul(buf, 10, &res) < 0 ||  res > MAX_ORDER / 2) {
-               printk(KERN_ERR "Bad debug_guardpage_minorder value\n");
+               pr_err("Bad debug_guardpage_minorder value\n");
                return 0;
        }
        _debug_guardpage_minorder = res;
-       printk(KERN_INFO "Setting debug_guardpage_minorder to %lu\n", res);
+       pr_info("Setting debug_guardpage_minorder to %lu\n", res);
        return 0;
 }
 __setup("debug_guardpage_minorder=", debug_guardpage_minorder_setup);
@@ -2851,8 +2858,12 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
                         * XXX: Page reclaim didn't yield anything,
                         * and the OOM killer can't be invoked, but
                         * keep looping as per tradition.
+                        *
+                        * But do not keep looping if oom_killer_disable()
+                        * was already called, for the system is trying to
+                        * enter a quiescent state during suspend.
                         */
-                       *did_some_progress = 1;
+                       *did_some_progress = !oom_killer_disabled;
                        goto out;
                }
                if (pm_suspended_storage())
@@ -4073,8 +4084,7 @@ static int __parse_numa_zonelist_order(char *s)
        } else if (*s == 'z' || *s == 'Z') {
                user_zonelist_order = ZONELIST_ORDER_ZONE;
        } else {
-               printk(KERN_WARNING
-                      "Ignoring invalid numa_zonelist_order value:  %s\n", s);
+               pr_warn("Ignoring invalid numa_zonelist_order value:  %s\n", s);
                return -EINVAL;
        }
        return 0;
@@ -5458,8 +5468,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat)
                                               "  %s zone: %lu pages used for memmap\n",
                                               zone_names[j], memmap_pages);
                        } else
-                               printk(KERN_WARNING
-                                       "  %s zone: %lu pages exceeds freesize %lu\n",
+                               pr_warn("  %s zone: %lu pages exceeds freesize %lu\n",
                                        zone_names[j], memmap_pages, freesize);
                }
 
@@ -5667,8 +5676,7 @@ static unsigned long __init find_min_pfn_for_node(int nid)
                min_pfn = min(min_pfn, start_pfn);
 
        if (min_pfn == ULONG_MAX) {
-               printk(KERN_WARNING
-                       "Could not find start_pfn for node %d\n", nid);
+               pr_warn("Could not find start_pfn for node %d\n", nid);
                return 0;
        }
 
@@ -6686,11 +6694,8 @@ void *__init alloc_large_system_hash(const char *tablename,
        if (!table)
                panic("Failed to allocate %s hash table\n", tablename);
 
-       printk(KERN_INFO "%s hash table entries: %ld (order: %d, %lu bytes)\n",
-              tablename,
-              (1UL << log2qty),
-              ilog2(size) - PAGE_SHIFT,
-              size);
+       pr_info("%s hash table entries: %ld (order: %d, %lu bytes)\n",
+               tablename, 1UL << log2qty, ilog2(size) - PAGE_SHIFT, size);
 
        if (_hash_shift)
                *_hash_shift = log2qty;
@@ -7191,8 +7196,8 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
                BUG_ON(!PageBuddy(page));
                order = page_order(page);
 #ifdef CONFIG_DEBUG_VM
-               printk(KERN_INFO "remove from free list %lx %d %lx\n",
-                      pfn, 1 << order, end_pfn);
+               pr_info("remove from free list %lx %d %lx\n",
+                       pfn, 1 << order, end_pfn);
 #endif
                list_del(&page->lru);
                rmv_page_order(page);