Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp620044rwo; Wed, 2 Aug 2023 01:06:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlHZKntJ6U+lT1BrL2L9gdqDLGtltpK/Z6njUgTAKRXtNKyRepOhbW6omKxtr7baYqyD16B/ X-Received: by 2002:a19:2d4b:0:b0:4fb:89e3:5ac6 with SMTP id t11-20020a192d4b000000b004fb89e35ac6mr4232152lft.62.1690963559879; Wed, 02 Aug 2023 01:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690963559; cv=none; d=google.com; s=arc-20160816; b=GKZsphdnNSo5pPp+LFx27S13Uyk3P1GxHRmgs2lU+4aO0SHLjFipJ52zzAT0BDBq/8 qM+EvkoFKULJTerSihPN6Gst8aemchG2EXOUi3ivRvNl6sDWxA+O5IO9X2wC1jfgjVvg n4xxenuhCI26/kZxWP6ADy9UwEP5vrMOH4EnuzXQ+U570OFv7X1zoYYVhozsoh+5DgQt ykxhrgdwALJ7bwQ8zZwmPzt3sy+4HUNdbvAQM7O9xffnesEW4IxLYiezDlIljnAE3s4Q ri+v3bMRkdsE3CSYQDBghS9lt0+6eLNlqRT8FF7fbfzjRH7H2GAJa0IAQ+bSedd4MHlc k7eA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6e6GiqmpyVCzOwvyGHqSNXCNxBFa7aDIzwYUNSYMUSM=; fh=rBQ43GLcScsAyAZCelwcYzyIpesXoXO3T0QG3vQEiiA=; b=LO7hHUzzBRYt/S+KY4gaO2qlclUyTLNRRYK2qcQSycsdjFqSTwirpZAMGLiNjh2m6K IsH7FzvQGbHImQilJRZxKLrQHBjS1TaYwQNC+J9VslYDmVhlI1DTv90DYf8P4ECtLFCo a0HAkf/zFjYSa7dXD2FL34MrsONZrLrMxdSCwObjlQI3qTnS0ywF4uv8zuVbkgVE7Z+g zmd38bGo6Su3h7zMFbXg+TnNYi9Xdz2CItom/CTEZH/9pnFgQhAMjGszYupppugN86I1 KjDXIcFXGnywcXoYwtydw9NgEpTxafLux9J+sH5hQf+UMe3IA4a/SPmbMwVLyfAIpJuu v2bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=J+S11sgO; 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 w9-20020aa7cb49000000b0051e242852fasi9374781edt.584.2023.08.02.01.05.34; Wed, 02 Aug 2023 01:05:59 -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=J+S11sgO; 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 S231901AbjHBHnW (ORCPT + 99 others); Wed, 2 Aug 2023 03:43:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233308AbjHBHmc (ORCPT ); Wed, 2 Aug 2023 03:42:32 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE60130D8; Wed, 2 Aug 2023 00:40:18 -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 8A1631F749; Wed, 2 Aug 2023 07:40:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1690962017; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6e6GiqmpyVCzOwvyGHqSNXCNxBFa7aDIzwYUNSYMUSM=; b=J+S11sgO6aiS75myCJ8iLCSy282SRXv1ywdO5YwOTHEIVWLCWo+CmZolywZvDiekiULT7E vWy7yPZAHd+/5e7nl5xlTRsvC9Ke8RqcIZJSFGjS/fxw80Gp6IoVhZvIX5Ru4mir/H7nD1 u3KKzJjm5zGmBVBQNz63u0Wcjp13FkY= 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 6B3A513909; Wed, 2 Aug 2023 07:40:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XYsOF2EIymQ9JwAAMHmgww (envelope-from ); Wed, 02 Aug 2023 07:40:17 +0000 Date: Wed, 2 Aug 2023 09:40:16 +0200 From: Michal Hocko To: Yosry Ahmed Cc: Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3] mm: memcg: use rstat for non-hierarchical stats Message-ID: References: <20230726153223.821757-1-yosryahmed@google.com> <20230726153223.821757-2-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 On Tue 01-08-23 10:29:39, Yosry Ahmed wrote: > On Tue, Aug 1, 2023 at 9:39 AM Yosry Ahmed wrote: [...] > > > Have you measured any potential regression for cgroup v2 which collects > > > all this data without ever using it (AFAICS)? > > > > I did not. I did not expect noticeable regressions given that all the > > extra work is done during flushing, which should mostly be done by the > > asynchronous worker, but can also happen in the stats reading context. > > Let me run the same script on cgroup v2 just in case and report back. > > A few runs on mm-unstable with this patch: > > # time cat /sys/fs/cgroup/cg*/memory.stat > /dev/null Is this really representative test to make? I would have expected the overhead would be mostly in mem_cgroup_css_rstat_flush (if it is visible at all of course). This would be more likely visible in all cpus busy situation (you can try heavy parallel kernel build from tmpfs for example). [...] > It looks like there are no regressions on cgroup v2 when reading the > stats. Please let me know if you want me to send a new version with > the cgroup v2 results as well in the commit log -- or I can just send > a new commit log. Whatever is easier for Andrew. Updating the changelog should be good enough. -- Michal Hocko SUSE Labs