Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761479AbcLAVYV (ORCPT ); Thu, 1 Dec 2016 16:24:21 -0500 Received: from mail-vk0-f68.google.com ([209.85.213.68]:33256 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759045AbcLAVYR (ORCPT ); Thu, 1 Dec 2016 16:24:17 -0500 MIME-Version: 1.0 In-Reply-To: <20161201132156.21450-1-mhocko@kernel.org> References: <20161201132156.21450-1-mhocko@kernel.org> From: Balbir Singh Date: Fri, 2 Dec 2016 08:24:16 +1100 Message-ID: Subject: Re: [PATCH] mm: workingset: fix NULL ptr in count_shadow_nodes To: Michal Hocko Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , =?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= , linux-mm , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 737 Lines: 18 On Fri, Dec 2, 2016 at 12:21 AM, Michal Hocko wrote: > From: Michal Hocko > > 0a6b76dd23fa ("mm: workingset: make shadow node shrinker memcg aware") > has made the workingset shadow nodes shrinker memcg aware. The > implementation is not correct though because memcg_kmem_enabled() might > become true while we are doing a global reclaim when the sc->memcg might > be NULL which is exactly what Marek has seen: > > > - if (memcg_kmem_enabled()) { > + if (sc->memcg) { > pages = mem_cgroup_node_nr_lru_pages(sc->memcg, sc->nid, > LRU_ALL_FILE); > } else { Acked-by: Balbir Singh