mm/list_lru.c: fix list_lru_count_node() to be race free
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(). Change-Id: I19e3b527804e95be75f48ee363c8207c0e7ee2ff Link: http://lkml.kernel.org/r/1498707555-30525-1-git-send-email-stummala@codeaurora.org Signed-off-by:Sahitya Tummala <stummala@codeaurora.org> Cc: Jan Kara <jack@suse.cz> Cc: Vladimir Davydov <vdavydov.dev@gmail.com> Cc: Alexander Polakov <apolyakov@beget.ru> Cc: Al Viro <viro@zeniv.linux.org.uk> Patch-mainline: linux-mm @ 29/06/17, 09:09:15 Signed-off-by:
Andrew Morton <akpm@linux-foundation.org>
Loading
Please register or sign in to comment