[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170830123655.6kce7yfkrhrhwubu@dhcp22.suse.cz>
Date: Wed, 30 Aug 2017 14:36:55 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Roman Gushchin <guro@...com>
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 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?
>
> @@ -5886,8 +5889,7 @@ void mem_cgroup_uncharge_skmem(struct mem_cgroup *memcg, unsigned int nr_pages)
>
> this_cpu_sub(memcg->stat->count[MEMCG_SOCK], nr_pages);
>
> - page_counter_uncharge(&memcg->memory, nr_pages);
> - css_put_many(&memcg->css, nr_pages);
> + refill_stock(memcg, nr_pages);
> }
This makes sense to me.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists