Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8215318rwd; Tue, 20 Jun 2023 11:48:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5RnSnvt9QzYklEu7EkHj9D3IYCNFDllsB99voGP3MCfSeM1L3MoeOV+Zl5P998Ubx9NS9T X-Received: by 2002:a17:902:ea0a:b0:1b5:2ca9:f71b with SMTP id s10-20020a170902ea0a00b001b52ca9f71bmr18435886plg.11.1687286899300; Tue, 20 Jun 2023 11:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687286899; cv=none; d=google.com; s=arc-20160816; b=ltCsJ8jnDQleO9jyukozaOFB/Iix9wA1flcZeGnDb4PMDUMmcXLnvtf6tMXN4JIkLs 432XmotI9ZL82qI1mMlp1XRhrEU40rMmGseogX3ZqyxqWFgDn+lTgFoimt00j7G3eEbg 0sgcEmIyDyQGLiW19FJuLyMMuFosLk12YJfWHC1HWYx+xp4dq8osWL+CQM0evc3NhfLw Vey63tkqOc8N6/KYjOmbmm1JJelB7cSoJWVkAv9bL+iV/Abk8IsMusAZS0QBHV4dPGgf r1FxWH+QawviiqNMU+eC6Tc6zsqSh5f6qaR6bT/mx3+ikEFygI6H8lYHES+HtziaOUU0 OTmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=rFbvkXsr4CwoXTBxubkyGQRrKVV7vjMo0YaS6cmSpvY=; b=moInaXmJ/gLlgiZacoQLASBBHuLwaSZzlzMa+/CNG7OsKVCPNBkSXJx3iJNt09+DC3 jjvWRVi6l9vHAq9HSVMpNPSakn1GyFOkVr+Mw5JaQSw58cRh6WBJM67mSi5JGFdh2STv jIW1HGEqrb4k5qm44jrM+74NlVe2+UmqKN79B3UhfEZvNWiHofSFJgGZFWAQ5b5T9Ega rLN6Jxz5STnAZ8NpnnGiyN9RO1hJBfNrvwNWEgHyuYcIm+BP2TkykL9LzcDOT2+hVaN+ 03WQc1KoMWh/FwqtNiF5AcB+iZ9p8oJD4xcS6Gwnrx10+pynNMRKZKfKJX0fNJ3L9iR8 njyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="s/c6tS2o"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p15-20020a170902e74f00b001ac78ac2c9csi2701241plf.573.2023.06.20.11.48.04; Tue, 20 Jun 2023 11:48:19 -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=@google.com header.s=20221208 header.b="s/c6tS2o"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229726AbjFTS2i (ORCPT + 99 others); Tue, 20 Jun 2023 14:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjFTS2g (ORCPT ); Tue, 20 Jun 2023 14:28:36 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 971B310CE for ; Tue, 20 Jun 2023 11:28:34 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f9087fe166so271345e9.1 for ; Tue, 20 Jun 2023 11:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687285713; x=1689877713; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rFbvkXsr4CwoXTBxubkyGQRrKVV7vjMo0YaS6cmSpvY=; b=s/c6tS2ooBamHjhW13lHYSQjuiL9w2u4j7wJkYXgvTp4qV2mzF6TcixK0rWzgIBnoW BstA/5FFTmUREVNKPxBC8p5k0unaa8BO4lbwg5+5HaWBTQ+EyIQcHvsqcdJke/3TcuH3 q7pQHBT3Q6mhkyumpKUrcMMGdRlva7pmkR2tnUFFt+c7aCgwq0rR5RJIJ1pnPEIcE0Rk tDA3F7vlTCotGqsQJzU06iJwGm5oDGmLFEWRL4CuoogKHzHZzyaw5LBQ6XK8fmVFSBBj +MzONGmtCK3l/t2go7eX0LhtSbV+a6o9DZlaxEQEU4/qUt4wTv/xrw9OqtlbS0sxRtQ0 bEgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687285713; x=1689877713; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rFbvkXsr4CwoXTBxubkyGQRrKVV7vjMo0YaS6cmSpvY=; b=VjWo1RbIv1gxav9xdfCUIiz57l/Gqrsdv9sguoYZbp1Et92u4eUH0HuNC1t5BkoOC0 GvZPgWcfmLcR/E/It61B2qN98+NLGqlZ5V1SMTwai89CmLhQUp+qeVDIfFotIbPmemYp yzAVWDeyoV6Ac/J+1Wq0YPhT05+Q/yXtBPFnp5lnQuV1aCz0xKVou+QDB2yPORRu4Hw0 SQFfeMNxCnn1aetBiGdJaLtsVYIMrs0hJ78Lri2Rmd1juCM/mbxpbYXcvAKFcWjDpk3N 2fz5svjelW9bDRtY8joBVpFkXn7IpaLK+9OGtrS237Ye3aAvMdIx4cKFj0fJBYl8/9Je nF+g== X-Gm-Message-State: AC+VfDwDdG6H2XaymaSPxcZhoA5PsNYdxAXfZySprrEhW1Uz1U0Rqwwu B09KlsxZG8MAgDHLF3eFfFxZPUNCPcWSOqUGC/70zA== X-Received: by 2002:a05:600c:4f91:b0:3f7:e59f:2183 with SMTP id n17-20020a05600c4f9100b003f7e59f2183mr158615wmq.5.1687285712945; Tue, 20 Jun 2023 11:28:32 -0700 (PDT) MIME-Version: 1.0 References: <20230612232748.3948659-1-joshdon@google.com> <20230612232748.3948659-2-joshdon@google.com> In-Reply-To: From: Josh Don Date: Tue, 20 Jun 2023 11:28:21 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] sched: add throttled time stat for throttled children To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Tejun Heo , Zefan Li , Johannes Weiner , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Xiangling Kong Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Hi Michal, On Mon, Jun 19, 2023 at 10:53=E2=80=AFAM Michal Koutn=C3=BD wrote: > > On Mon, Jun 12, 2023 at 04:27:48PM -0700, Josh Don w= rote: > > We currently export the total throttled time for cgroups that are given > > a bandwidth limit. > > I assume you refer to cpu.stat:throttled_usec (from struct > cfs_bandwidth) -- notice that the value is not properly hierarchical > despite v2 filename. > > > This patch extends this accounting to also account the total time that > > each children cgroup has been throttled. > > IIUC, this is visible on inner-nodes cpu cgroups (i.e. with no tasks)? > > IOW, wouldn't you get the intended information if hierarchical summing > was added/fixed for cpu.stat:throttled_usec? It isn't currently hierarchical in the sense that the inner-nodes don't themselves account their throttled time, but the summation at the top is still correct. This patch is intended to close the gap. I suppose your question here is why not simply make the existing throttled_usec export properly hierarchical, and avoid the extra stat export here. I think it might be useful to still expose a non-hierarchical metric indicating the throttled time due to the group's own configured limit; the accounting can look strange with nested bandwidth limits. Not strongly opposed to the idea, but your hierarchical accounting proposal is essentially what this patch adds.