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=-11.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 5A6A7C433E2 for ; Thu, 2 Jul 2020 16:03:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1EDA7207D4 for ; Thu, 2 Jul 2020 16:03:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="RqGpjMEF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1EDA7207D4 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 A62A86B00EB; Thu, 2 Jul 2020 12:03:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A13B66B00EE; Thu, 2 Jul 2020 12:03:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 929D86B00EF; Thu, 2 Jul 2020 12:03:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 7ECC26B00EB for ; Thu, 2 Jul 2020 12:03:40 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 62F8B2C8B for ; Thu, 2 Jul 2020 16:03:39 +0000 (UTC) X-FDA: 76993606158.15.road77_350f67d26e8a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 8042D18027F8E for ; Thu, 2 Jul 2020 16:02:45 +0000 (UTC) X-HE-Tag: road77_350f67d26e8a X-Filterd-Recvd-Size: 4329 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Jul 2020 16:02:44 +0000 (UTC) Received: by mail-lj1-f169.google.com with SMTP id e4so32935391ljn.4 for ; Thu, 02 Jul 2020 09:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qL79Nq3oCLFzOTMGpWbet7Io9CHFHxAF6y2OIH7P7B4=; b=RqGpjMEFoC3lPt7KB5/BrJPpVJGiDboNINqnwfCYmwDrhIvPjrU8U25m/Sjjsza80o gwFlMK3yYzKmar3WB1+skx2vfiyQIUhmkGMckZnhQOgw7kQFuXw7s26o6FwmY5Ialcq9 mRWAxhnwDxCbuZPYuVI8jOPnzFzUVRGvsygQtP+VMypMmGE0tvuJwmlp1vbGuhgq8To0 /pmULktjB/VuQnV8+bwdvvgkTOpuiMJ5UN7U7K44+WoZ1bJ1fy9SSpt3I9WYn9K6vMPC RXG5tl9aFn5Dl0iSVKQxdnoVYpGRdYuF1bThn0bYrsmSotKsa4hU4euoPK4GC/XCGbr4 dRTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qL79Nq3oCLFzOTMGpWbet7Io9CHFHxAF6y2OIH7P7B4=; b=YG7tKKgmUM/9EgweERBnn9566qpnXnF+aW8qj8NCFO5SGQJmMpa6d6EQa2pC3+E6ZR 4i5ZAPv2zEGrmr2kOe+7CD0D2poufg0Klqy3ujFvYtiMjj/IqmEQVZMRVv/fPswdWfkU EuC7EpijkJBUh0t1i2G4x0bubc0ee36B8WSmYkrkTuX5gmWp2c65wIUeOHOmaS/dw+bJ BKAHF+CJo7BenoCPpxxts1C8ewbDre5qmEPJVmhCavYy7AI8OWwYHQbDSTDt7ql1VRU4 ojE7ye/dYP6DneK5COA7yVPoDKCHtuwvguRrm3uWMvB/AOXp9gubrSJZiqECKzZ7+tVE udOQ== X-Gm-Message-State: AOAM5324yRRaFz9DX3fMs3em4WcDwbFl7cIqt/EO3216e2WFTt9KjKD3 Iwl32ziqcKi6DKk18AggfVGMNZtY/+w8OAkJI+ewkWze X-Google-Smtp-Source: ABdhPJzCSv9gW+kUPkCq9nD0isczBmSZEYe52kFZeGBvtWJCQvuyMUHN2aap+/6Q57WOe2Z+S0BUzBeDFfKgGNHmdBI= X-Received: by 2002:a2e:8e36:: with SMTP id r22mr16765350ljk.77.1593705763073; Thu, 02 Jul 2020 09:02:43 -0700 (PDT) MIME-Version: 1.0 References: <20200701082904.GM2369@dhcp22.suse.cz> <20200701184552.GA61684@carbon.DHCP.thefacebook.com> In-Reply-To: <20200701184552.GA61684@carbon.DHCP.thefacebook.com> From: Shakeel Butt Date: Thu, 2 Jul 2020 09:02:31 -0700 Message-ID: Subject: Re: BUG: Bad page state in process - page dumped because: page still charged to cgroup To: Roman Gushchin Cc: Michal Hocko , Naresh Kamboju , Johannes Weiner , Andrew Morton , linux-mm , open list , lkft-triage@lists.linaro.org, Chris Down Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 8042D18027F8E 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 Wed, Jul 1, 2020 at 11:46 AM 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 Reviewed-by: Shakeel Butt