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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4F6AC6FD20 for ; Fri, 24 Mar 2023 17:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229921AbjCXRLd (ORCPT ); Fri, 24 Mar 2023 13:11:33 -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> 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-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal =?utf-8?Q?Koutn=C3=BD?= Subject: Re: [PATCH 1/1] mm: memcontrol: fix vmstats_percpu state incorrect subtraction after reparent Date: Fri, 24 Mar 2023 18:11:14 +0100 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" Return-path: 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= Content-Disposition: inline In-Reply-To: <20230320030648.50663-2-caixinchen1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> List-ID: To: Cai Xinchen Cc: songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org, shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, duanxiongchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, yosryahmed-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, mpenttil-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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--