From patchwork Mon Jan 4 05:03:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 11996149 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=-25.1 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL 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 3AD75C433DB for ; Mon, 4 Jan 2021 05:04:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 957BD20780 for ; Mon, 4 Jan 2021 05:04:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 957BD20780 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 934CE6B00C3; Mon, 4 Jan 2021 00:04:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E5AB6B00C4; Mon, 4 Jan 2021 00:04:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 785C26B00C5; Mon, 4 Jan 2021 00:04:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id 5FFE26B00C3 for ; Mon, 4 Jan 2021 00:04:14 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 204E68248047 for ; Mon, 4 Jan 2021 05:04:14 +0000 (UTC) X-FDA: 77666901228.22.tax12_0417b2c274cd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id D769818038E79 for ; Mon, 4 Jan 2021 05:04:13 +0000 (UTC) X-HE-Tag: tax12_0417b2c274cd X-Filterd-Recvd-Size: 4294 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 Jan 2021 05:04:13 +0000 (UTC) Received: by mail-oi1-f179.google.com with SMTP id w124so30944289oia.6 for ; Sun, 03 Jan 2021 21:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=dEV0wZXe8t4cW6sTq8NdrlzUWo8syyjgpiwm3vuG8Cw=; b=c/F6Ym9/e/H4Pj5c5Ix6yhLWlC914Jqt6+hjcjTM1vJaXcGUv5/Ls4WJeLTuCK6l4F maEkoE8SKMoS4aL7RCMV/SBT6NDGhJbLcy0p6mDfLaWfAeifE2wXZfxf4tdK5eQxJQDv hmvsuj5JCL5Eqr0z4kCNuPl48/+AyRsmSWBGrjYcAv9NjCZBKNjXOW6NLPMPpH8hX+8R CF+EPz1pOg0gyzFulPim0pcLdBQeddBlKnn8yX4NjnsrRwhkz0a/Y2/mfT+yOf2ozKzd Cy2VqbooOgyJMGB78lEYWrf4b/jzk8M6wtLAOrxa28zHs3HDinRnFjVIVJS2CmMMQ13G I9gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version; bh=dEV0wZXe8t4cW6sTq8NdrlzUWo8syyjgpiwm3vuG8Cw=; b=bB8WIXUw+EMCsNqkR/veD25FSce41FhcqQj6HjaHwHOIKYi7k6laHws6SiozDoA4la hAojaOkHnQR4A4DDA4A7r7NMfCp61gAvudW4GtJgU1iMH6J3SCabXupjEtahCwjsjlQF /RVcaQF76bT+qUAlRBWzNlCrrNdbZVCZuXRP5ElTweWxcknKx3CrV/XA8A+3hfTZ+IXB Q9dNPKU9Rcq/M+C9DY0n2KWWbyr49gNgjRYFKxxjGkJZ3YqvbNGEvFCnxOpxk1YcoVPD xXHVYfXXUOc1ttF4MxrZD8NIox8zj7qM5/tFBEFSZ4gQmsdrWJNi3j04QCH78yoxJhYe uDRA== X-Gm-Message-State: AOAM5329LH1NeO6ZIzSA1LuZbQo8Jbf/3Wu60+mzxDXlzOA3bHgghiJA cURzSs+WtJT1KXbWIap7JPk6FQ== X-Google-Smtp-Source: ABdhPJwUENfJggxNQsrF/y2HWOhsCRk/hrxcIqAn6mtWboxwkSJ3JlsSCEWuqbwbiVjOjvU5W1W4hA== X-Received: by 2002:aca:5786:: with SMTP id l128mr16891541oib.145.1609736652718; Sun, 03 Jan 2021 21:04:12 -0800 (PST) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id d10sm9326911ooh.32.2021.01.03.21.04.11 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Sun, 03 Jan 2021 21:04:12 -0800 (PST) Date: Sun, 3 Jan 2021 21:03:58 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: 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 Subject: [PATCH] mm/memcontrol: fix warning in mem_cgroup_page_lruvec() Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 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: 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 Reviewed-by: Alex Shi Reviewed-by: Baoquan He Acked-by: Chris Down 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); return mem_cgroup_lruvec(memcg, pgdat); }