Greg Thelen 484ebb3b8c 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>
2015-10-01 21:42:35 -04:00
..
2015-09-10 13:29:01 -07:00
2015-06-24 17:49:45 -07:00
2015-09-10 13:29:01 -07:00
2015-09-11 16:42:39 -07:00
2015-04-15 16:35:18 -07:00
2015-09-11 16:42:39 -07:00
2015-09-08 14:35:59 -07:00
2015-09-08 15:35:28 -07:00
2015-10-01 21:42:35 -04:00
2015-02-11 17:06:02 -08:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-08 15:35:28 -07:00
2015-09-10 13:29:01 -07:00
2015-09-08 15:35:28 -07:00
2015-09-10 13:29:01 -07:00
2015-09-08 15:35:28 -07:00