Re: [PATCH v2 6/6] mm: refactor memcg_hotplug_cpu_dead() to use memcg_flush_offline_percpu()

2019-03-13 Thread Roman Gushchin
On Wed, Mar 13, 2019 at 12:07:49PM -0400, Johannes Weiner wrote: > On Tue, Mar 12, 2019 at 03:34:04PM -0700, Roman Gushchin wrote: > > @@ -2180,50 +2179,8 @@ static int memcg_hotplug_cpu_dead(unsigned int cpu) > > + for_each_mem_cgroup(memcg) > > + memcg_flush_offline_percpu(memcg,

Re: [PATCH v2 6/6] mm: refactor memcg_hotplug_cpu_dead() to use memcg_flush_offline_percpu()

2019-03-13 Thread Johannes Weiner
On Tue, Mar 12, 2019 at 03:34:04PM -0700, Roman Gushchin wrote: > @@ -2180,50 +2179,8 @@ static int memcg_hotplug_cpu_dead(unsigned int cpu) > + for_each_mem_cgroup(memcg) > + memcg_flush_offline_percpu(memcg, get_cpu_mask(cpu)); cpumask_of(cpu) is the official API function, with

[PATCH v2 6/6] mm: refactor memcg_hotplug_cpu_dead() to use memcg_flush_offline_percpu()

2019-03-12 Thread Roman Gushchin
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