Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
[firefly-linux-kernel-4.4.55.git] / mm / page_alloc.c
index 22cfdeffbf691d9f1a5c5ebb00788ce3e7a8b103..df542feaac3bb6ce749c408cca37623af9ad19bf 100644 (file)
@@ -640,8 +640,10 @@ static inline int free_pages_check(struct page *page)
                bad_reason = "PAGE_FLAGS_CHECK_AT_FREE flag(s) set";
                bad_flags = PAGE_FLAGS_CHECK_AT_FREE;
        }
-       if (unlikely(mem_cgroup_bad_page_check(page)))
-               bad_reason = "cgroup check failed";
+#ifdef CONFIG_MEMCG
+       if (unlikely(page->mem_cgroup))
+               bad_reason = "page still charged to cgroup";
+#endif
        if (unlikely(bad_reason)) {
                bad_page(page, bad_reason, bad_flags);
                return 1;
@@ -900,8 +902,10 @@ static inline int check_new_page(struct page *page)
                bad_reason = "PAGE_FLAGS_CHECK_AT_PREP flag set";
                bad_flags = PAGE_FLAGS_CHECK_AT_PREP;
        }
-       if (unlikely(mem_cgroup_bad_page_check(page)))
-               bad_reason = "cgroup check failed";
+#ifdef CONFIG_MEMCG
+       if (unlikely(page->mem_cgroup))
+               bad_reason = "page still charged to cgroup";
+#endif
        if (unlikely(bad_reason)) {
                bad_page(page, bad_reason, bad_flags);
                return 1;
@@ -1986,7 +1990,7 @@ zonelist_scan:
 
        /*
         * Scan zonelist, looking for a zone with enough free.
-        * See also __cpuset_node_allowed_softwall() comment in kernel/cpuset.c.
+        * See also __cpuset_node_allowed() comment in kernel/cpuset.c.
         */
        for_each_zone_zonelist_nodemask(zone, z, zonelist,
                                                high_zoneidx, nodemask) {
@@ -1997,7 +2001,7 @@ zonelist_scan:
                                continue;
                if (cpusets_enabled() &&
                        (alloc_flags & ALLOC_CPUSET) &&
-                       !cpuset_zone_allowed_softwall(zone, gfp_mask))
+                       !cpuset_zone_allowed(zone, gfp_mask))
                                continue;
                /*
                 * Distribute pages in proportion to the individual
@@ -2525,7 +2529,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask)
                        alloc_flags |= ALLOC_HARDER;
                /*
                 * Ignore cpuset mems for GFP_ATOMIC rather than fail, see the
-                * comment for __cpuset_node_allowed_softwall().
+                * comment for __cpuset_node_allowed().
                 */
                alloc_flags &= ~ALLOC_CPUSET;
        } else if (unlikely(rt_task(current)) && !in_interrupt())