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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <gthelen@xxxxxxxxxx> wrote:
[...]
> >> I assume it's pretty straightforward to create generic
> >> percpu_counter_array routines which memcg could use.  Possibly something
> >> like this could be made general enough could be created to satisfy
> >> vmstat, but less clear.
> >> 
> >> [1] http://www.spinics.net/lists/cgroups/msg06216.html
> >> [2] https://lkml.org/lkml/2014/9/11/1057
> >
> > That all sounds rather bogus to me.  __percpu_counter_add() doesn't
> > modify struct percpu_counter at all except for when the cpu-local
> > counter overflows the configured batch size.  And for the memcg
> > application I suspect we can set the batch size to INT_MAX...
> 
> Nod.  The memory usage will be a bit larger, but the code reuse is
> attractive.  I dusted off Vladimir's
> https://lkml.org/lkml/2014/9/11/710.  Next step is to benchmark it
> before posting.

I am definitely in favor of using generic per-cpu counters.

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]