This is a note to let you know that I've just added the patch titled

    mm/memcg: iteration skip memcgs not yet fully initialized

to the 3.13-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mm-memcg-iteration-skip-memcgs-not-yet-fully-initialized.patch
and it can be found in the queue-3.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From d8ad30559715ce97afb7d1a93a12fd90e8fff312 Mon Sep 17 00:00:00 2001
From: Hugh Dickins <[email protected]>
Date: Thu, 23 Jan 2014 15:53:32 -0800
Subject: mm/memcg: iteration skip memcgs not yet fully initialized

From: Hugh Dickins <[email protected]>

commit d8ad30559715ce97afb7d1a93a12fd90e8fff312 upstream.

It is surprising that the mem_cgroup iterator can return memcgs which
have not yet been fully initialized.  By accident (or trial and error?)
this appears not to present an actual problem; but it may be better to
prevent such surprises, by skipping memcgs not yet online.

Signed-off-by: Hugh Dickins <[email protected]>
Cc: Tejun Heo <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Johannes Weiner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 mm/memcontrol.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1100,10 +1100,8 @@ skip_node:
         * protected by css_get and the tree walk is rcu safe.
         */
        if (next_css) {
-               struct mem_cgroup *mem = mem_cgroup_from_css(next_css);
-
-               if (css_tryget(&mem->css))
-                       return mem;
+               if ((next_css->flags & CSS_ONLINE) && css_tryget(next_css))
+                       return mem_cgroup_from_css(next_css);
                else {
                        prev_css = next_css;
                        goto skip_node;


Patches currently in stable-queue which might be from [email protected] are

queue-3.13/memcg-fix-css-reference-leak-and-endless-loop-in-mem_cgroup_iter.patch
queue-3.13/memcg-fix-endless-loop-caused-by-mem_cgroup_iter.patch
queue-3.13/mm-memcg-iteration-skip-memcgs-not-yet-fully-initialized.patch
queue-3.13/mm-munlock-fix-potential-race-with-thp-page-split.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to