lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 Aug 2017 13:57:29 +0100
From:   Roman Gushchin <guro@...com>
To:     Michal Hocko <mhocko@...nel.org>
CC:     <linux-mm@...ck.org>, Johannes Weiner <hannes@...xchg.org>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        <cgroups@...r.kernel.org>, <kernel-team@...com>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory
 uncharging

On Wed, Aug 30, 2017 at 02:55:43PM +0200, Michal Hocko wrote:
> On Wed 30-08-17 13:44:59, Roman Gushchin wrote:
> > On Wed, Aug 30, 2017 at 02:36:55PM +0200, Michal Hocko wrote:
> > > On Tue 29-08-17 11:01:50, Roman Gushchin wrote:
> > > [...]
> > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > > > index b9cf3cf4a3d0..a69d23082abf 100644
> > > > --- a/mm/memcontrol.c
> > > > +++ b/mm/memcontrol.c
> > > > @@ -1792,6 +1792,9 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages)
> > > >  	}
> > > >  	stock->nr_pages += nr_pages;
> > > >  
> > > > +	if (stock->nr_pages > CHARGE_BATCH)
> > > > +		drain_stock(stock);
> > > > +
> > > >  	local_irq_restore(flags);
> > > >  }
> > > 
> > > Why do we need this? In other words, why cannot we rely on draining we
> > > already do?
> > 
> > The existing draining depends on memory pressure, so to keep
> > the accounting (which we expose to a user) reasonable accurate
> > even without memory pressure, we need to limit the size of per-cpu stocks.
> 
> Why don't we need this for regular page charges? Or maybe we do but that
> sounds like a seprate and an unrealted fix to me.

Because we never refill more than CHARGE_BATCH.

Powered by blists - more mailing lists