Re: [PATCH v2 3/6] memcg: introduce memsw_accounting_users

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

 



On Tue 29-01-13 13:46:33, Glauber Costa wrote:
> Hi,
> 
> On 01/28/2013 02:54 PM, Jeff Liu wrote:
> > As we don't account the swap stat number for the root_mem_cgroup anymore,
> > here we can just return an invalid CSS ID if there is no non-root memcg
> > is alive.  Also, introduce memsw_accounting_users to track the number of
> > active non-root memcgs.
> > 
> > Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx>
> > CC: Glauber Costa <glommer@xxxxxxxxxxxxx>
> > CC: Michal Hocko <mhocko@xxxxxxx>
> > CC: Kamezawa Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> > CC: Johannes Weiner <hannes@xxxxxxxxxxx>
> > CC: Mel Gorman <mgorman@xxxxxxx>
> > CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> > CC: Sha Zhengju <handai.szj@xxxxxxxxxx>
> > 
> > ---
> >  mm/page_cgroup.c |   16 +++++++++++++++-
> >  1 file changed, 15 insertions(+), 1 deletion(-)
> > 
> > diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
> > index c945254..189fbf5 100644
> > --- a/mm/page_cgroup.c
> > +++ b/mm/page_cgroup.c
> > @@ -336,6 +336,8 @@ struct swap_cgroup {
> >  };
> >  #define SC_PER_PAGE	(PAGE_SIZE/sizeof(struct swap_cgroup))
> >  
> > +static atomic_t memsw_accounting_users = ATOMIC_INIT(0);
> > +
> 
> I am not seeing this being incremented or decremented. I can only guess
> that it comes in later patches. However, they are clearly used as a
> global reference counter.
> 
> This is precisely one of the use cases static branches solve very
> neatly. Did you consider using them?
> 
> True, they will help a lot more when we are touching hot paths, and swap
> is hardly a hot path.
> 
> However, since one of the main complaints about memcg has been that we
> inflict "death by a thousand cuts", maybe it wouldn't hurt everything
> else being the same.
> 
> Michal and others, do you have any feelings here?
 
I would leave a static branch change to a separate patch. Make it work
first and only then care about how it looks.
-- 
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]