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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 894F9C5517A for ; Tue, 10 Nov 2020 02:57:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E6EBE206ED for ; Tue, 10 Nov 2020 02:57:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.b="SajSFgVH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6EBE206ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 400DB6B0036; Mon, 9 Nov 2020 21:57:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B13A6B005C; Mon, 9 Nov 2020 21:57:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A0686B005D; Mon, 9 Nov 2020 21:57:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0134.hostedemail.com [216.40.44.134]) by kanga.kvack.org (Postfix) with ESMTP id EE00F6B0036 for ; Mon, 9 Nov 2020 21:57:54 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7D7081EE6 for ; Tue, 10 Nov 2020 02:57:54 +0000 (UTC) X-FDA: 77466998868.24.girl41_1404b71272f1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 53B531A4A0 for ; Tue, 10 Nov 2020 02:57:54 +0000 (UTC) X-HE-Tag: girl41_1404b71272f1 X-Filterd-Recvd-Size: 5928 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 02:57:53 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id e21so8878720pgr.11 for ; Mon, 09 Nov 2020 18:57:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I5rP8g6hbwpalFY9R3djgaCnvHELnDvXyVufjhRMTp4=; b=SajSFgVHD3t008BCAfms7vYRMyHVUNzVRoA9PWFZhXui2O65vHkM6DHm76/JFdYwd0 Ao1jHwv2xVK7DR+x9csXBc4CgxDrYzZa3pmQThaX6k5GCMWtjXcEfOclD/YCPx+bD/V/ 8GoKyIpwouyJ9qZhDEjPxCEFAdDiQ2Vi/wZJD0Y3y5sOG0ILsxFZo2b90YigtXRCw514 3UxAGOMfv4mUYklolS4667iUrk8HLWMrCIwuv091M1pJA+PeL/L9qb+WVvEsF//ZW1DK 86t/cwgS059JrMj9k5kPJaS7bn/qeTnp9LTbRi+rZ7LvPPy/tw1ShgVSm5jsl49b0DvM 1dqQ== 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=I5rP8g6hbwpalFY9R3djgaCnvHELnDvXyVufjhRMTp4=; b=VhRUx2QciIezaT0JjTUMqCTjusmlHmZPtuuZH581TdAFF3zGS958zd99GXjr4LO17x U/kahrYmNVMCxSn2Ta1V9+JsFGnAiFOWT/yPgVaXa9/sEZYkR2c/4bFXaAZ66MnnklJy h7KGjVWWmh2rKoYpUJ9Be9kAhVKj//yVuWOErL9nrza0otyY9lPk0UHKLLVHjCzec37a DgckFP8sh80KgHLhekD+6KKpjjZEZ3IRLEfXhjuqvBGW03ofqG6weY7bffAW4h9mtTK9 My3WkYsfFQsQyjLk/QINDSzqzY4rGv6GN03L2Lxm8iQLDi7kKCrunn01tq4cMob60QGt rHdw== X-Gm-Message-State: AOAM531QgdR+T6dU6+VZamYpjttPocvPpFdixAg9jp9U1oqfSeqeRZD+ hkjbZGhQToq2SUNn1OkHbEiwZAw+0xNCpcTdNcJNIg== X-Google-Smtp-Source: ABdhPJxdBbEXq4Wwv7KcDH91L5LSKHsQCubNvPyNBN2i9pd3XRGWN3xcgrQbQ3hk95uYjRIE42rpxP0qtBtjfj6pixo= X-Received: by 2002:a17:90a:8086:: with SMTP id c6mr2517944pjn.147.1604977072730; Mon, 09 Nov 2020 18:57:52 -0800 (PST) MIME-Version: 1.0 References: <20201027080256.76497-1-songmuchun@bytedance.com> <20201027080256.76497-5-songmuchun@bytedance.com> <20201027184835.GB827280@carbon.dhcp.thefacebook.com> <20201029001408.GF827280@carbon.dhcp.thefacebook.com> <20201110013236.GB2612097@carbon.dhcp.thefacebook.com> In-Reply-To: <20201110013236.GB2612097@carbon.dhcp.thefacebook.com> From: Muchun Song Date: Tue, 10 Nov 2020 10:57:16 +0800 Message-ID: Subject: Re: [External] Re: [PATCH 4/5] mm: memcg/slab: Fix root memcg vmstats To: Roman Gushchin Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Shakeel Butt , Joonsoo Kim , Yafang Shao , Chris Down , Christian Brauner , Peter Zijlstra , Ingo Molnar , Kees Cook , Thomas Gleixner , esyr@redhat.com, Suren Baghdasaryan , areber@redhat.com, Marco Elver , LKML , Cgroups , Linux Memory Management List Content-Type: text/plain; charset="UTF-8" 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 Tue, Nov 10, 2020 at 9:33 AM Roman Gushchin wrote: > > On Thu, Oct 29, 2020 at 02:15:43PM +0800, Muchun Song wrote: > > On Thu, Oct 29, 2020 at 8:14 AM Roman Gushchin wrote: > > > > > > On Wed, Oct 28, 2020 at 10:56:20AM +0800, Muchun Song wrote: > > > > On Wed, Oct 28, 2020 at 2:48 AM Roman Gushchin wrote: > > > > > > > > > > On Tue, Oct 27, 2020 at 04:02:55PM +0800, Muchun Song wrote: > > > > > > If we reparent the slab objects to the root memcg, when we free > > > > > > the slab object, we need to update the per-memcg vmstats to keep > > > > > > it correct for the root memcg. Now this at least affects the vmstat > > > > > > of NR_KERNEL_STACK_KB for !CONFIG_VMAP_STACK when the thread stack > > > > > > size is smaller than the PAGE_SIZE. > > > > > > > > > > > > Fixes: ec9f02384f60 ("mm: workingset: fix vmstat counters for shadow nodes") > > > > > > Signed-off-by: Muchun Song > > > > > > > > > > Can you, please, drop this patch for now? > > > > > > > > > > I'm working on a bigger cleanup related to the handling of the root memory > > > > > cgroup (I sent a link earlier in this thread), which already does a similar change. > > > > > There are several issues like this one, so it will be nice to fix them all at once. > > > > > > > > I have read the patch of https://lkml.org/lkml/2020/10/14/869. You > > > > mean this patch > > > > fixes this issue? It chooses to uncharge the root memcg. But here we may need to > > > > uncharge the root memcg to keep root vmstats correct. If we do not do > > > > this, we can > > > > see the wrong vmstats via root memory.stat(e.g. NR_KERNEL_STACK_KB). > > > > > > I pointed at a different patch in the same thread (it looks like you read the first one): > > > https://lkml.org/lkml/2020/10/21/612 > > Hi Muchun! > > Can you please, resend your patch? The planned cleanup of the root memory cgroup > is more complex than expected, so I think it makes sense to merge your patch without > waiting for it. I'm sorry for delaying it initially. OK, I will do that. Thanks. > > Please, feel free to add > Acked-by: Roman Gushchin > > Thank you! > > Roman -- Yours, Muchun