Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13654887pxu; Mon, 4 Jan 2021 00:13:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSGT5KFTuu9TiOxO7vRCG4QV0JkjurwxfHp/ENToeM+DhJZn0ysRqsSzU461WDkCeHJWGj X-Received: by 2002:a17:907:6e6:: with SMTP id yh6mr67092785ejb.512.1609748002608; Mon, 04 Jan 2021 00:13:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609748002; cv=none; d=google.com; s=arc-20160816; b=0HO+Ux38eKvXWYAHr2hwUbylkeuRTI+ybqMk9mi5MTBvRg81Ke+AwRuMSMYjNgavDL uy8bwTlOe/rx+QBpkm5hDfRtj2SijoMrwbDpUugnivzzpSXWhuQetwldrNAvNatl/Igv H1HpURQ+nF/bLn4PVeVoESLvTPxtqRLj4QagJkok1dzntTIZeHKsXveJ2wG/ZqrD01Es 8SbYIQfmrUu9xBt+GXFNgKtRBPMHjL0cUZQinaNIbr7rrxqMCfH4zpBpQAuFaxSPs3CR Bgvk7gSLfs/D4OvaAFp/5KBTosRbCeus56TKcxpapWCcXmrVnx13iAJo6nrBfiCZMzna m/VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=N8sb/gO//mj/rzIKebXebD+5g4QnHO+O/KQR0z27hn4=; b=C0fqY77nz7apYjhRNi/MO/wOFDrJhDFjn9RY9CmXaoaFuCGm00ov4k1pXfCH+1F0jg vRGPWBN3WviS2/rL41wayvR4QLhMzW+oRJzo+eG1hTD5moPgLhB0ToqKSKR2k02tqhwB yKsQezGo+vpclTVM2nIVIhoXg/GE6wUA2flyOBLVHtc8YTUdza7Avc6gX9jjOW6IQNJ5 06ggPklkRaZ34R/cAgZa3/KMPI1uYHTlXeMRqt+45SaT0Pa9Wp+3SJVHdJMSZIsTrwBL FhnjgdmVIw/B21O+yaJHWbro5e4EMMyeuRDu8vwHtmvW5koXOmYROPFhmO5H28/wGtAZ b/tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq5si7682256edb.200.2021.01.04.00.12.59; Mon, 04 Jan 2021 00:13:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726563AbhADIL4 (ORCPT + 99 others); Mon, 4 Jan 2021 03:11:56 -0500 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:51424 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726306AbhADIL4 (ORCPT ); Mon, 4 Jan 2021 03:11:56 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0UKeYYmw_1609747872; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0UKeYYmw_1609747872) by smtp.aliyun-inc.com(127.0.0.1); Mon, 04 Jan 2021 16:11:13 +0800 Subject: Re: [PATCH] mm/memcontrol: fix warning in mem_cgroup_page_lruvec() To: Hugh Dickins , Andrew Morton Cc: Hui Su , Lorenzo Stoakes , Michal Hocko , Johannes Weiner , Shakeel Butt , Roman Gushchin , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: From: Alex Shi Message-ID: <2c1083cb-53d6-1cd6-9e1b-14a501db6f9a@linux.alibaba.com> Date: Mon, 4 Jan 2021 16:11:12 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Alex Shi ?? 2021/1/4 ????1:03, Hugh Dickins ะด??: > 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 > --- > > 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); > return mem_cgroup_lruvec(memcg, pgdat); > } > >