diff options
author | Greg Thelen <gthelen@google.com> | 2015-10-01 22:37:05 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-10-02 01:42:35 (GMT) |
commit | 484ebb3b8c8b27dd2171696462a3116edb9ff801 (patch) | |
tree | 1056eab0960e2ec868c6a5cfd3076d05ee5887a3 /drivers/input | |
parent | 0610c25daa3e76e38ad5a8fae683a89ff9f71798 (diff) | |
download | linux-484ebb3b8c8b27dd2171696462a3116edb9ff801.tar.xz |
memcg: make mem_cgroup_read_stat() unsigned
mem_cgroup_read_stat() returns a page count by summing per cpu page
counters. The summing is racy wrt. updates, so a transient negative
sum is possible. Callers don't want negative values:
- mem_cgroup_wb_stats() doesn't want negative nr_dirty or nr_writeback.
This could confuse dirty throttling.
- oom reports and memory.stat shouldn't show confusing negative usage.
- tree_usage() already avoids negatives.
Avoid returning negative page counts from mem_cgroup_read_stat() and
convert it to unsigned.
[akpm@linux-foundation.org: fix old typo while we're in there]
Signed-off-by: Greg Thelen <gthelen@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: <stable@vger.kernel.org> [4.2+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/input')
0 files changed, 0 insertions, 0 deletions