Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1422179rwl; Fri, 24 Mar 2023 10:16:04 -0700 (PDT) X-Google-Smtp-Source: AKy350aKpLrQca21r1KIdkVg+n9qGBALRcLo0HN+m4S484hF7gwrdFB5UT0U5tlUlWcdlFjdnp+m X-Received: by 2002:a17:902:d2c9:b0:1a1:cefd:aa1f with SMTP id n9-20020a170902d2c900b001a1cefdaa1fmr4047617plc.52.1679678164469; Fri, 24 Mar 2023 10:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679678164; cv=none; d=google.com; s=arc-20160816; b=oqUVi2aNDOxi8LbkRnp0TiLAe1FfJrlIYpOWpI7pO/4WqD9bE+Wsr2pkR53C3ca/uc ej04S+S+Mzt0AVzamSvCUsfXbYpmNFmJJeeyTINcbafps822QSnkdY6snu2l4PP/QxJp brc0okePa3UGffJLeQxRoEDktmo126oOxoPXJ9t1wrgNFfHTg4jhgAAzOCdgGSYfVvNK ZIUIEQFeeaO5ygbOR4HYtrOrg52p74/jLu8CLxcT3zRgrTfM5CLmBDvnzDro02YEhDTL LCdKf2gjec8O0UxcTESvhVDTVCHX3gvH3tNptpTgYMj4/r+3uo914U+7uMJVLmaUXpDw 9Jyg== 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=porIllnFw2p86E2ijRdzEbR8T3FBX2CIBdas6/Gd6LM=; b=s8wibU94h31LGOFQrn6b/ET7gls3wNQOSHsowKCqZXTSq+8i1JA86FGjLuh6N93bqv up4fCA+Tez4PfCRJwzh+dmnn7wQRRl86bd1JjiSvQrU/b/FZq5X6LIfYNY1+QESR7liH 4Ux9PwZm7sFz0yGO3aAPBDao/w1ptc5wYX3vKssF7uzWatMkbSg3ZqNkK3AuY6DJuhB+ qlaajf4NlsrD7EvlYBhKN9T+kwFATvie8CbYoJCLSUVlgeaP548XKoHfWItxU2T3uZbf nL0FSa32/b2XfyruvRhslOOXyL5O5yuf1GFvmunxUeEWN1tQkajgSZrJFqKdy72+OcmG QKfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="jNC/qpMi"; 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 p10-20020a1709026b8a00b0019e912312e0si20837223plk.84.2023.03.24.10.15.52; Fri, 24 Mar 2023 10:16:04 -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="jNC/qpMi"; 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 S232048AbjCXROp (ORCPT + 99 others); Fri, 24 Mar 2023 13:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231905AbjCXROe (ORCPT ); Fri, 24 Mar 2023 13:14:34 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E06C95B9D; Fri, 24 Mar 2023 10:14:14 -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 3DCFA1FF94; Fri, 24 Mar 2023 17:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679678053; 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=porIllnFw2p86E2ijRdzEbR8T3FBX2CIBdas6/Gd6LM=; b=jNC/qpMiWtn8ZgQtU4A5VS7jMHFB68+eObtzqVIN51ypAMW/Ky4K3757kbkbewPI+S4o0/ 9wP6YVvSr/W/oORA3ewkTTignhMg2px7JA36e5FimP8QjD85IoHibcNR2Z7Ztuxr5A9Dyc CB5+QL8FBM5fxNh5CZY/p5MsWHl3hYg= 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 EEF14138ED; Fri, 24 Mar 2023 17:14:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id u2xkOWTaHWSDJQAAMHmgww (envelope-from ); Fri, 24 Mar 2023 17:14:12 +0000 Date: Fri, 24 Mar 2023 18:14:11 +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 0/1] Fix vmstat_percpu incorrect subtraction after reparent Message-ID: <20230324171411.t2romq3ydphoonu2@blackpad> References: <20230320030648.50663-1-caixinchen1@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7ps5la3sopyo7hm5" Content-Disposition: inline In-Reply-To: <20230320030648.50663-1-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 --7ps5la3sopyo7hm5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 20, 2023 at 03:06:47AM +0000, Cai Xinchen wrote: > There are two problems left: >=20 > root > / \ > A B > / \ \ > C E D >=20 > 1. In some case of reparent, some page cache may be used by other memcg > D but it charges to the parent memcg A of dying memcg E. D is getting > away with using the page for free while A is taxed. Note that A is (effectively) taxed even before E is removed due to hierarchical nature of charging. Then what you describe transforms into "well-known" problem of shared charging (with not well-known solution :-/). HTH, Michal --7ps5la3sopyo7hm5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTrXXag4J0QvXXBmkMkDQmsBEOquQUCZB3aYQAKCRAkDQmsBEOq uULUAQCHRvKpQPSDHUkOEFl2uZo3E7GeJT8AUOQoAsdb9Scv3wEA6jAYPC9q+nvp FbwIeniHgYs6j4F0z5/Y/u/CsVBLuQw= =CvmU -----END PGP SIGNATURE----- --7ps5la3sopyo7hm5--