All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Gushchin <guro@fb.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: <linux-mm@kvack.org>, Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	<cgroups@vger.kernel.org>, <kernel-team@fb.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging
Date: Wed, 30 Aug 2017 13:44:59 +0100	[thread overview]
Message-ID: <20170830124459.GA10438@castle.DHCP.thefacebook.com> (raw)
In-Reply-To: <20170830123655.6kce7yfkrhrhwubu@dhcp22.suse.cz>

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.

Thanks!

WARNING: multiple messages have this Message-ID (diff)
From: Roman Gushchin <guro@fb.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	cgroups@vger.kernel.org, kernel-team@fb.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging
Date: Wed, 30 Aug 2017 13:44:59 +0100	[thread overview]
Message-ID: <20170830124459.GA10438@castle.DHCP.thefacebook.com> (raw)
In-Reply-To: <20170830123655.6kce7yfkrhrhwubu@dhcp22.suse.cz>

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.

Thanks!

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

  reply	other threads:[~2017-08-30 12:46 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 10:01 [PATCH] mm: memcontrol: use per-cpu stocks for socket memory uncharging Roman Gushchin
2017-08-29 10:01 ` Roman Gushchin
2017-08-29 10:01 ` Roman Gushchin
2017-08-29 19:26 ` Johannes Weiner
2017-08-29 19:26   ` Johannes Weiner
2017-08-30 10:55   ` Roman Gushchin
2017-08-30 10:55     ` Roman Gushchin
2017-08-30 10:55     ` Roman Gushchin
2017-09-07 18:44     ` Shakeel Butt
2017-09-07 18:44       ` Shakeel Butt
2017-09-07 18:47       ` Roman Gushchin
2017-09-07 18:47         ` Roman Gushchin
2017-09-07 18:47         ` Roman Gushchin
2017-09-07 19:43         ` Shakeel Butt
2017-09-07 19:43           ` Shakeel Butt
2017-08-30 10:57   ` Roman Gushchin
2017-08-30 10:57     ` Roman Gushchin
2017-08-30 10:57     ` Roman Gushchin
2017-08-30 12:36 ` Michal Hocko
2017-08-30 12:36   ` Michal Hocko
2017-08-30 12:36   ` Michal Hocko
2017-08-30 12:44   ` Roman Gushchin [this message]
2017-08-30 12:44     ` Roman Gushchin
2017-08-30 12:55     ` Michal Hocko
2017-08-30 12:55       ` Michal Hocko
2017-08-30 12:57       ` Roman Gushchin
2017-08-30 12:57         ` Roman Gushchin
2017-08-30 14:23         ` Michal Hocko
2017-08-30 14:23           ` Michal Hocko
2017-08-30 14:24 ` Michal Hocko
2017-08-30 14:24   ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170830124459.GA10438@castle.DHCP.thefacebook.com \
    --to=guro@fb.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=vdavydov.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.