scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer()
[cascardo/linux.git] / mm / memcontrol.c
index c265212..66beca1 100644 (file)
@@ -2559,6 +2559,15 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,
                return 0;
 
        mctz = soft_limit_tree_node(pgdat->node_id);
+
+       /*
+        * Do not even bother to check the largest node if the root
+        * is empty. Do it lockless to prevent lock bouncing. Races
+        * are acceptable as soft limit is best effort anyway.
+        */
+       if (RB_EMPTY_ROOT(&mctz->rb_root))
+               return 0;
+
        /*
         * This loop can run a while, specially if mem_cgroup's continuously
         * keep exceeding their soft limit and putting the system under