Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752013AbdGAQ2c (ORCPT ); Sat, 1 Jul 2017 12:28:32 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33831 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751871AbdGAQ2a (ORCPT ); Sat, 1 Jul 2017 12:28:30 -0400 Date: Sat, 1 Jul 2017 19:28:25 +0300 From: Vladimir Davydov To: Sahitya Tummala Cc: Alexander Polakov , Andrew Morton , Jan Kara , viro@zeniv.linux.org.uk, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v4 1/2] mm/list_lru.c: fix list_lru_count_node() to be race free Message-ID: <20170701162825.2gravl52jm4ggtzj@esperanza> References: <20170628171854.t4sjyjv55j673qzv@esperanza> <1498707555-30525-1-git-send-email-stummala@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1498707555-30525-1-git-send-email-stummala@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 564 Lines: 13 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 Acked-by: Vladimir Davydov