Merge tag 'char-misc-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[linux-2.6-microblaze.git] / mm / page_alloc.c
index 8b7d0ec..fab5e97 100644 (file)
@@ -666,8 +666,6 @@ void prep_compound_page(struct page *page, unsigned int order)
        int i;
        int nr_pages = 1 << order;
 
-       set_compound_page_dtor(page, COMPOUND_PAGE_DTOR);
-       set_compound_order(page, order);
        __SetPageHead(page);
        for (i = 1; i < nr_pages; i++) {
                struct page *p = page + i;
@@ -675,6 +673,9 @@ void prep_compound_page(struct page *page, unsigned int order)
                p->mapping = TAIL_MAPPING;
                set_compound_head(p, page);
        }
+
+       set_compound_page_dtor(page, COMPOUND_PAGE_DTOR);
+       set_compound_order(page, order);
        atomic_set(compound_mapcount_ptr(page), -1);
        if (hpage_pincount_available(page))
                atomic_set(compound_pincount_ptr(page), 0);
@@ -1301,6 +1302,11 @@ static void free_pcppages_bulk(struct zone *zone, int count,
        struct page *page, *tmp;
        LIST_HEAD(head);
 
+       /*
+        * Ensure proper count is passed which otherwise would stuck in the
+        * below while (list_empty(list)) loop.
+        */
+       count = min(pcp->count, count);
        while (count) {
                struct list_head *list;
 
@@ -7887,7 +7893,7 @@ int __meminit init_per_zone_wmark_min(void)
 
        return 0;
 }
-core_initcall(init_per_zone_wmark_min)
+postcore_initcall(init_per_zone_wmark_min)
 
 /*
  * min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so