Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-25 Thread Greg Thelen
Michal Hocko wrote: > On Tue 22-09-15 15:16:32, Greg Thelen wrote: >> 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() doe

Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-25 Thread Michal Hocko
On Tue 22-09-15 15:16:32, Greg Thelen wrote: > 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

Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-25 Thread Michal Hocko
On Wed 23-09-15 00:21:33, Greg Thelen wrote: > > Andrew Morton wrote: > > > On Tue, 22 Sep 2015 17:42:13 -0700 Greg Thelen wrote: [...] > >> I assume it's pretty straightforward to create generic > >> percpu_counter_array routines which memcg could use. Possibly something > >> like this could b

Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-23 Thread Greg Thelen
Andrew Morton wrote: > On Tue, 22 Sep 2015 17:42:13 -0700 Greg Thelen wrote: > >> Andrew Morton wrote: >> >> > On Tue, 22 Sep 2015 15:16:32 -0700 Greg Thelen wrote: >> > >> >> mem_cgroup_read_stat() returns a page count by summing per cpu page >> >> counters. The summing is racy wrt. updates,

Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-22 Thread Andrew Morton
On Tue, 22 Sep 2015 17:42:13 -0700 Greg Thelen wrote: > Andrew Morton wrote: > > > On Tue, 22 Sep 2015 15:16:32 -0700 Greg Thelen wrote: > > > >> 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 > >

Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-22 Thread Greg Thelen
Andrew Morton wrote: > On Tue, 22 Sep 2015 15:16:32 -0700 Greg Thelen wrote: > >> 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

Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-22 Thread Andrew Morton
On Tue, 22 Sep 2015 15:16:32 -0700 Greg Thelen wrote: > 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 negativ