Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1420140rwl; Fri, 24 Mar 2023 10:14:39 -0700 (PDT) X-Google-Smtp-Source: AKy350ba6Q+6BPDVnRhq9gL052z0Wym3dwQ5uaKdfeTTDPiuAPbAuVfYP4TiK/3thidVkihVFLlC X-Received: by 2002:a17:90a:191a:b0:229:649a:9a05 with SMTP id 26-20020a17090a191a00b00229649a9a05mr3842698pjg.11.1679678078896; Fri, 24 Mar 2023 10:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679678078; cv=none; d=google.com; s=arc-20160816; b=eDxhwaN9B/EMhTWaj8KoRDCLtvr+bJ5xilWspqqVNX3MFM71nygaJCvMm7SLd9i2ZI eaSJLUBlGnder7yt/WZY6fM/I+LvmipnfxCphCQPwMYNuqFc9859AgJX8DPqslXVdXd8 JJ5Xx4pJ5updyvJ2e+bOv5N1zVEp/9WBSSWo2rB7gddGw4ZougCuXuIxdufVMFLUtoaz 1pSTQITR4AdgJJHwFSJIHx0dap0yJtzuEKiZLSxrU3N/LgcKuh2E+rANhJGtbHnfR5ox cY1pcZM2cuy6OAm1o59eu8XXLnCVgyImfy5LaER0JDD8D7bZTq1RT708YwKkWjmNeJdL /5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tWmn6S5YIs367DkBrcliyowrdz09FT4jicvN67WVd1Q=; b=ctqJKjpK4E4Ur7kkcdKfWuYtcNODuxJne0I5/baXWoD5j08sijleArJWINapuUkBbT A1UyZtjG/jLvSovt44hKOv+7cpq7Nm424RSvHzEh3Oj1JkOgxnRrlLHu8otIl9vN8f9L zwQBauinxJsaNnVv5g3uoJHjHulMxHa6YUhBwv+2VkxpZ1ocpmWCMX2CfD47VZrhYbBs GdhroM1Pxa9a3n1IQB/UKySj2wnPA2R3iET8gDLFIem7JOu1EKiOYzT86bd7RV/aqwF7 kSuZkY+zrEx7GoHIejAj0cJE4JVsELdTrKcv21nXx1HkdQ1nqfz6WbgXPaP591cEeob8 rtTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Eku5Ernz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t22-20020a17090aba9600b0023f58e27405si259159pjr.32.2023.03.24.10.14.26; Fri, 24 Mar 2023 10:14:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Eku5Ernz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232013AbjCXRLc (ORCPT + 99 others); Fri, 24 Mar 2023 13:11:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232009AbjCXRLa (ORCPT ); Fri, 24 Mar 2023 13:11:30 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDE6C21942; Fri, 24 Mar 2023 10:11:17 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3AB011FF94; Fri, 24 Mar 2023 17:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679677876; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tWmn6S5YIs367DkBrcliyowrdz09FT4jicvN67WVd1Q=; b=Eku5Ernzy7mmNguDiowGGaJXYc7ZQ2vU1KA46inl7ZfH1RKMVqbk8gnL3KMsKyAYqEMkRf 2Om7zsa2zVwanBak0bzaUtO90jxztxVY5c1O9xoFBMa4ej1q6pdLlSZYzj4RAjiYcBxMmD v7hqcgJV90Eh9vjW41I6rIxVrngWD6Q= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E0157138ED; Fri, 24 Mar 2023 17:11:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HW2INbPZHWQwJAAAMHmgww (envelope-from ); Fri, 24 Mar 2023 17:11:15 +0000 Date: Fri, 24 Mar 2023 18:11:14 +0100 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Cai Xinchen Cc: songmuchun@bytedance.com, akpm@linux-foundation.org, hannes@cmpxchg.org, longman@redhat.com, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, cgroups@vger.kernel.org, duanxiongchun@bytedance.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, yosryahmed@google.com, mpenttil@redhat.com Subject: Re: [PATCH 1/1] mm: memcontrol: fix vmstats_percpu state incorrect subtraction after reparent Message-ID: <20230324171114.32oru5sdubfsfvgi@blackpad> References: <20230320030648.50663-1-caixinchen1@huawei.com> <20230320030648.50663-2-caixinchen1@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zdhfeu2yhc5s3ooc" Content-Disposition: inline In-Reply-To: <20230320030648.50663-2-caixinchen1@huawei.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zdhfeu2yhc5s3ooc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello. On Mon, Mar 20, 2023 at 03:06:48AM +0000, Cai Xinchen wrote: > When memcg C is offllined, its pages are reparented to memcg P, > so far P->vmstats (hierarchical) have those pages, and > P->vmstats_percpu (non-hierarchical) don't. When those pages get > uncharged, P->vmstats (hierachical) decreases, which is correct, > but P->vmstats_percpu (non-hierarchical) also decreases, which > is wrong, as those stats were never added to P->vmstats_percpu to > begin with. I was wondering why ->vmstats_percpu matters (in the end all is summed in ->vmstats) -- do you mean this is a cgroup v1 only issue? As only that exposes the non-hieararchical stats. Thanks, Michal --zdhfeu2yhc5s3ooc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTrXXag4J0QvXXBmkMkDQmsBEOquQUCZB3ZsAAKCRAkDQmsBEOq ubgvAP0S0+i6gFMj+uLkO7p+vwL0oN12X2x0vhGGOkGva271GAD/RP/Nz+EJ6cb5 hc9lBjB3CbP+EKpYGdVof3rKoyv4Wws= =uY3T -----END PGP SIGNATURE----- --zdhfeu2yhc5s3ooc--