[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190313194846.GA6683@cmpxchg.org>
Date: Wed, 13 Mar 2019 15:48:46 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Roman Gushchin <guroan@...il.com>
Cc: linux-mm@...ck.org, kernel-team@...com,
linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>,
Rik van Riel <riel@...riel.com>,
Michal Hocko <mhocko@...nel.org>, Roman Gushchin <guro@...com>
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_data_entry()
> for_each_cpu(cpu. cpumask)
> sum_events()
> flush()
>
> Otherwise it would be one atomic operation per data entry per cpu:
> for_each_cpu(cpu)
> for_each_data_entry()
> flush()
>
> Signed-off-by: Roman Gushchin <guro@...com>
Acked-by: Johannes Weiner <hannes@...xchg.org>
Powered by blists - more mailing lists