aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorGlauber Costa <glommer@parallels.com>2012-04-12 15:49:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-12 16:12:12 -0400
commit569530fb1b40ab2d2ca147ee79898ac807ebdf90 (patch)
treee9f4f9a04a9a8f2a94a919aff55629f8946b30f4 /mm
parent32050017cf3bf2b983571a90351328b4f66e463d (diff)
memcg: do not open code accesses to res_counter members
We should use the accessor res_counter_read_u64 for that. Although a purely cosmetic change is sometimes better delayed, to avoid conflicting with other people's work, we are starting to have people touching this code as well, and reproducing the open code behavior because that's the standard =) Time to fix it, then. Signed-off-by: Glauber Costa <glommer@parallels.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index ea1e879b2db6..a7165a60d0a7 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3763,7 +3763,7 @@ move_account:
3763 goto try_to_free; 3763 goto try_to_free;
3764 cond_resched(); 3764 cond_resched();
3765 /* "ret" should also be checked to ensure all lists are empty. */ 3765 /* "ret" should also be checked to ensure all lists are empty. */
3766 } while (memcg->res.usage > 0 || ret); 3766 } while (res_counter_read_u64(&memcg->res, RES_USAGE) > 0 || ret);
3767out: 3767out:
3768 css_put(&memcg->css); 3768 css_put(&memcg->css);
3769 return ret; 3769 return ret;
@@ -3778,7 +3778,7 @@ try_to_free:
3778 lru_add_drain_all(); 3778 lru_add_drain_all();
3779 /* try to free all pages in this cgroup */ 3779 /* try to free all pages in this cgroup */
3780 shrink = 1; 3780 shrink = 1;
3781 while (nr_retries && memcg->res.usage > 0) { 3781 while (nr_retries && res_counter_read_u64(&memcg->res, RES_USAGE) > 0) {
3782 int progress; 3782 int progress;
3783 3783
3784 if (signal_pending(current)) { 3784 if (signal_pending(current)) {