From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2828C433DB for ; Thu, 7 Jan 2021 18:04:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6205823370 for ; Thu, 7 Jan 2021 18:04:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6205823370 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A79708D0141; Thu, 7 Jan 2021 13:04:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A2ABD8D013A; Thu, 7 Jan 2021 13:04:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F1E78D0141; Thu, 7 Jan 2021 13:04:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id 781278D013A for ; Thu, 7 Jan 2021 13:04:35 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3A7558245571 for ; Thu, 7 Jan 2021 18:04:35 +0000 (UTC) X-FDA: 77679754110.09.boats13_5506ad0274ec Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 224BE180AD817 for ; Thu, 7 Jan 2021 18:04:35 +0000 (UTC) X-HE-Tag: boats13_5506ad0274ec X-Filterd-Recvd-Size: 2885 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 Jan 2021 18:04:34 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 63ED1AD19; Thu, 7 Jan 2021 18:04:33 +0000 (UTC) Subject: Re: [PATCH] mm/memcontrol: fix warning in mem_cgroup_page_lruvec() To: Hugh Dickins , Andrew Morton Cc: Hui Su , Alex Shi , Lorenzo Stoakes , Michal Hocko , Johannes Weiner , Shakeel Butt , Roman Gushchin , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: From: Vlastimil Babka Message-ID: Date: Thu, 7 Jan 2021 19:04:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 1/4/21 6:03 AM, Hugh Dickins wrote: > Boot a CONFIG_MEMCG=y kernel with "cgroup_disabled=memory" and you are > met by a series of warnings from the VM_WARN_ON_ONCE_PAGE(!memcg, page) > recently added to the inline mem_cgroup_page_lruvec(). > > An earlier attempt to place that warning, in mem_cgroup_lruvec(), had > been careful to do so after weeding out the mem_cgroup_disabled() case; > but was itself invalid because of the mem_cgroup_lruvec(NULL, pgdat) in > clear_pgdat_congested() and age_active_anon(). > > Warning in mem_cgroup_page_lruvec() was once useful in detecting a KSM > charge bug, so may be worth keeping: but skip if mem_cgroup_disabled(). > > Fixes: 9a1ac2288cf1 ("mm/memcontrol:rewrite mem_cgroup_page_lruvec()") > Signed-off-by: Hugh Dickins Acked-by: Vlastimil Babka > --- > > include/linux/memcontrol.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- 5.11-rc2/include/linux/memcontrol.h 2020-12-27 20:39:36.751923135 -0800 > +++ linux/include/linux/memcontrol.h 2021-01-03 19:38:24.822978559 -0800 > @@ -665,7 +665,7 @@ static inline struct lruvec *mem_cgroup_ > { > struct mem_cgroup *memcg = page_memcg(page); > > - VM_WARN_ON_ONCE_PAGE(!memcg, page); > + VM_WARN_ON_ONCE_PAGE(!memcg && !mem_cgroup_disabled(), page); Nit: I would reverse the order of conditions as mem_cgroup_disabled() is either "return true" or a static key. Not that it matters too much on DEBUG_VM configs... > return mem_cgroup_lruvec(memcg, pgdat); > } > >