diff options
| author | Michal Hocko <[email protected]> | 2013-04-29 22:07:18 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2013-04-29 22:54:33 +0000 |
| commit | 19f39402864ea3935b36ab1066c6283d6ea53f44 (patch) | |
| tree | 2a073f80c676db471735652122c9ac791adbd9d0 /fs/jbd/commit.c | |
| parent | memcg: relax memcg iter caching (diff) | |
| download | kernel-19f39402864ea3935b36ab1066c6283d6ea53f44.tar.gz kernel-19f39402864ea3935b36ab1066c6283d6ea53f44.zip | |
memcg: simplify mem_cgroup_iter
The current implementation of mem_cgroup_iter has to consider both css
and memcg to find out whether no group has been found (css==NULL - aka
the loop is completed) and that no memcg is associated with the found
node (!memcg - aka css_tryget failed because the group is no longer
alive). This leads to awkward tweaks like tests for css && !memcg to
skip the current node.
It will be much easier if we got rid off css variable altogether and
only rely on memcg. In order to do that the iteration part has to skip
dead nodes. This sounds natural to me and as a nice side effect we will
get a simple invariant that memcg is always alive when non-NULL and all
nodes have been visited otherwise.
We could get rid of the surrounding while loop but keep it in for now to
make review easier. It will go away in the following patch.
Signed-off-by: Michal Hocko <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Li Zefan <[email protected]>
Cc: Ying Han <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Glauber Costa <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'fs/jbd/commit.c')
0 files changed, 0 insertions, 0 deletions
