Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1595227ybt; Thu, 2 Jul 2020 09:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0sLeUIAty7AkRz1NCPudUYJOvDNWz0vkJbCihex1OmayDdjzyipPcfJjYxDAcuHgATzxd X-Received: by 2002:a50:8adb:: with SMTP id k27mr34503750edk.267.1593705941460; Thu, 02 Jul 2020 09:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593705941; cv=none; d=google.com; s=arc-20160816; b=uUsWEORieWGSdt9SIl6rScFg3ww3/ZqKMsnLdMbkjV25RMJmcsDijr3k0mPKdKsSNc R9hsp/jJlJ9xC2zeM6bSg/kGW1FKz/IIYKmwKb9JdLzVjmPU/4YzoRRV6hjY0T+L0ZqW r/2BodKP6GEpWxCAoRlqJGCMvANnrCQZvUPusq9Mrjha7ir1wrQbtSR3N565UCXbVnjw 0GuRVcs+JPygA2+5vqPp4IOqbAZvfgJ8LotFeIS4LfuhlfqGCkUwk1PqGJPdtPW+mDev ku1yA+eeTIer3RsFhUWm2kF85CD/K8NMm3UdY4yjda8F98puuu2ZFuM2huqYWxR+0dyD O0jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qL79Nq3oCLFzOTMGpWbet7Io9CHFHxAF6y2OIH7P7B4=; b=DKCacYXXNKMcq+LNgQko/wJlyrTTmQSA9AP76wODp629grgv1Q1B54VnNE97TC6wx3 gtlqfnlO/ONXxEpkTIQcWhYEQkR/yb+CVJg1yp2s+amncAiLHy0Lc2qLfndqdGNC6RnI 85x6s6V+vfZuphrqQtAX+hFTgOrOipak4Zik/8g0DpusTtCgfy+pnvlns/x4GxLKlwe5 QgdISWsOyo+B8u3U0EzR25nr1C1gh/BcOqlUalKeluWumyzdeqUuWHFRqc/dAA9LjDG4 16KBBEv5VASftQpxIfAKbEqKndW0BVfMw4JsVmdB52d0TMDYGtA7ObOmCYPY44kF71wb ruJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RqGpjMEF; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bv17si5987786ejb.263.2020.07.02.09.05.18; Thu, 02 Jul 2020 09:05:41 -0700 (PDT) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=RqGpjMEF; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726148AbgGBQCp (ORCPT + 99 others); Thu, 2 Jul 2020 12:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725379AbgGBQCp (ORCPT ); Thu, 2 Jul 2020 12:02:45 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA3D9C08C5C1 for ; Thu, 2 Jul 2020 09:02:44 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id b25so29319641ljp.6 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=bkcE9dxSNIxY4YoBZhig1JpMlK17XviKu93b0UCp/cFSODvOgiR5OvV1RROCXKezlX pk8UaRienwZoXUsP7yeppvZcdBiQUr2hkGaPFI+c/rikcSOetROkh/C05nKZMVT0s7aq xiR3UH7rDC7iSQhlNeQWsNqv+Ib3Q3jmr0CaEL1bt9+eBcZBZwaKtsnOaE3ouQ6HdR+t 3ri+N94w8sETyUvjcoeotYeKMMYA6KnuKWtaH2WjXLtbcHq/xw0uxW4eo4zl3M+lRfs6 mCqzr5l7sa1ksfGtly+MT+INEAuGnK5RiRKbLNDLFZf644/9h6kCD39YugEcoBd62QPw jw2Q== X-Gm-Message-State: AOAM530B7f4wLu8QznkBU023iY+Nhohdqmvbmi9+nJINx342u2W4RpS1 Gb+OKjTzR5BVHyw+mUJh+n1Q2AFazntnbOpsn1ADLw== 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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