Re: [PATCH v4 1/2] mm/list_lru.c: fix list_lru_count_node() to be race free

Vladimir Davydov
2017-07-01T16:28:32Z

On Thu, Jun 29, 2017 at 09:09:15AM +0530, Sahitya Tummala wrote:
> list_lru_count_node() iterates over all memcgs to get
> the total number of entries on the node but it can race with
> memcg_drain_all_list_lrus(), which migrates the entries from
> a dead cgroup to another. This can return incorrect number of
> entries from list_lru_count_node().
>
> Fix this by keeping track of entries per node and simply return
> it in list_lru_count_node().
>
> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>

Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>