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=-4.0 required=3.0 tests=MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 35711C433DF for ; Thu, 2 Jul 2020 17:10:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EB0F820720 for ; Thu, 2 Jul 2020 17:10:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB0F820720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7DADD6B0071; Thu, 2 Jul 2020 13:10:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B12B8D0011; Thu, 2 Jul 2020 13:10:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6EE458D000C; Thu, 2 Jul 2020 13:10:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 5AC3F6B0071 for ; Thu, 2 Jul 2020 13:10:27 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 175962C7C for ; Thu, 2 Jul 2020 17:10:27 +0000 (UTC) X-FDA: 76993774494.10.error73_220fc5726e8a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id B428E1698F3 for ; Thu, 2 Jul 2020 17:10:14 +0000 (UTC) X-HE-Tag: error73_220fc5726e8a X-Filterd-Recvd-Size: 4439 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Jul 2020 17:10:14 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id z17so24761644edr.9 for ; Thu, 02 Jul 2020 10:10:14 -0700 (PDT) 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:references :mime-version:content-disposition:in-reply-to; bh=UQMqU/oqcviJOT6ra19wu8jEYcT3DRqeElrxLzrejiE=; b=h/grodgT8aPIgSuJRd9ft+DwqI1tWQ52kiA5wGhFKCCeazSaW0LwCqOqKx4ALIPa3W IcSNAb1LGhcsO+kbHVuz8eIi5pJ/rl8y0dO0SxOPwesedR3Z0WNbAzVnciRVv9irSBkg Q5N3Hezv9BmO8fWZuhQ6M1QdCaSDRCmKZx+z3Vy7Z0dGBL6rQ84G41VCU+1c2pbvjC6b 4sNEQel9rdFKz8K1IzRwbjLZmUvlphogowZE7VhAocYnb64L6/CGC8QUGZK8o+dcNk4F PYYYZur8e7mLT1113kK5wMPXOLPpxBmJydjRuPbQLmNHC4CQqlGIqxInnAIQQZUEC5hr TrVg== X-Gm-Message-State: AOAM530lQUdnUEo5dzNKhHarbOopIGhEim0CMpv/MJ5STIZw0ENL6H6z 5em6lG9KsUI4D/K9JY18LMY= X-Google-Smtp-Source: ABdhPJzyGu71dP9RLdC6H2sfNId5snu3Frn1YijkjVhsim2Awf7BRCd1sb1+/DQWTr4J1fG7g0X5EQ== X-Received: by 2002:a05:6402:337:: with SMTP id q23mr36693172edw.63.1593709813149; Thu, 02 Jul 2020 10:10:13 -0700 (PDT) Received: from localhost (ip-37-188-168-3.eurotel.cz. [37.188.168.3]) by smtp.gmail.com with ESMTPSA id bw7sm7410420ejb.5.2020.07.02.10.10.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 10:10:12 -0700 (PDT) Date: Thu, 2 Jul 2020 19:10:11 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Roman Gushchin , Naresh Kamboju , Shakeel Butt , Johannes Weiner , Andrew Morton , linux-mm , open list , lkft-triage@lists.linaro.org, Chris Down , Peter Zijlstra Subject: Re: BUG: Bad page state in process - page dumped because: page still charged to cgroup Message-ID: <20200702171011.GJ18446@dhcp22.suse.cz> References: <20200701082904.GM2369@dhcp22.suse.cz> <20200701184552.GA61684@carbon.DHCP.thefacebook.com> <20200702162202.GI18446@dhcp22.suse.cz> <57270a15-a792-5175-757b-c4bde6da3694@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57270a15-a792-5175-757b-c4bde6da3694@suse.cz> X-Rspamd-Queue-Id: B428E1698F3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Thu 02-07-20 18:35:31, Vlastimil Babka wrote: > On 7/2/20 6:22 PM, Michal Hocko wrote: > > On Wed 01-07-20 11:45:52, Roman Gushchin wrote: > > [...] > >> >From c97afecd32c0db5e024be9ba72f43d22974f5bcd Mon Sep 17 00:00:00 2001 > >> From: Roman Gushchin > >> Date: Wed, 1 Jul 2020 11:05:32 -0700 > >> Subject: [PATCH] mm: kmem: make memcg_kmem_enabled() irreversible > >> > >> Historically the kernel memory accounting was an opt-in feature, which > >> could be enabled for individual cgroups. But now it's not true, and > >> it's on by default both on cgroup v1 and cgroup v2. And as long as a > >> user has at least one non-root memory cgroup, the kernel memory > >> accounting is on. So in most setups it's either always on (if memory > >> cgroups are in use and kmem accounting is not disabled), either always > >> off (otherwise). > >> > >> memcg_kmem_enabled() is used in many places to guard the kernel memory > >> accounting code. If memcg_kmem_enabled() can reverse from returning > >> true to returning false (as now), we can't rely on it on release paths > >> and have to check if it was on before. > >> > >> If we'll make memcg_kmem_enabled() irreversible (always returning true > >> after returning it for the first time), it'll make the general logic > >> more simple and robust. It also will allow to guard some checks which > >> otherwise would stay unguarded. > >> > >> Signed-off-by: Roman Gushchin > > Fixes: ? or let Andrew squash it to some patch of your series (it's in mmotm I > think)? I would rather make it its own patch because this is really subtle. -- Michal Hocko SUSE Labs