Skip to content

Commit

Permalink
memcg: correct comments for __mem_cgroup_begin_update_page_stat
Browse files Browse the repository at this point in the history
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Qiang Huang authored and Linus Torvalds committed Jun 4, 2014
1 parent bdcbb65 commit b5ffc85
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2276,12 +2276,11 @@ bool mem_cgroup_oom_synchronize(bool handle)
}

/*
* Currently used to update mapped file statistics, but the routine can be
* generalized to update other statistics as well.
* Used to update mapped file or writeback or other statistics.
*
* Notes: Race condition
*
* We usually use page_cgroup_lock() for accessing page_cgroup member but
* We usually use lock_page_cgroup() for accessing page_cgroup member but
* it tends to be costly. But considering some conditions, we doesn't need
* to do so _always_.
*
Expand All @@ -2295,8 +2294,8 @@ bool mem_cgroup_oom_synchronize(bool handle)
* by flags.
*
* Considering "move", this is an only case we see a race. To make the race
* small, we check mm->moving_account and detect there are possibility of race
* If there is, we take a lock.
* small, we check memcg->moving_account and detect there are possibility
* of race or not. If there is, we take a lock.
*/

void __mem_cgroup_begin_update_page_stat(struct page *page,
Expand Down

0 comments on commit b5ffc85

Please sign in to comment.