Re: [PATCH v3 6/6] mm: refactor memcg_hotplug_cpu_dead() to use memcg_flush_offline_percpu()
- Date: Wed, 13 Mar 2019 15:48:46 -0400
- From: Johannes Weiner <hannes@xxxxxxxxxxx>
- Subject: Re: [PATCH v3 6/6] mm: refactor memcg_hotplug_cpu_dead() to use memcg_flush_offline_percpu()
On Wed, Mar 13, 2019 at 11:39:53AM -0700, Roman Gushchin wrote:
> It's possible to remove a big chunk of the redundant code by making
> memcg_flush_offline_percpu() to take cpumask as an argument and flush
> percpu data on all cpus belonging to the mask instead of all possible cpus.
> Then memcg_hotplug_cpu_dead() can call it with a single CPU bit set.
> This approach allows to remove all duplicated code, but safe the
> performance optimization made in memcg_flush_offline_percpu():
> only one atomic operation per data entry.
> for_each_cpu(cpu. cpumask)
> Otherwise it would be one atomic operation per data entry per cpu:
> Signed-off-by: Roman Gushchin <guro@xxxxxx>
Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>