From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua0-f197.google.com (mail-ua0-f197.google.com [209.85.217.197]) by kanga.kvack.org (Postfix) with ESMTP id AC00A6B025E for ; Thu, 1 Dec 2016 16:24:17 -0500 (EST) Received: by mail-ua0-f197.google.com with SMTP id 34so247304520uac.6 for ; Thu, 01 Dec 2016 13:24:17 -0800 (PST) Received: from mail-vk0-x241.google.com (mail-vk0-x241.google.com. [2607:f8b0:400c:c05::241]) by mx.google.com with ESMTPS id f2si502217uaa.197.2016.12.01.13.24.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 13:24:16 -0800 (PST) Received: by mail-vk0-x241.google.com with SMTP id x186so11578097vkd.2 for ; Thu, 01 Dec 2016 13:24:16 -0800 (PST) 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 Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , =?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= , linux-mm , LKML 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 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org