Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp89747rwe; Wed, 24 Aug 2022 17:47:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6m1Qejd1Fevlk077jOkCWpMyzRrnLL1E/ed8cY9XOX6Xg16enRBJTDG7V2KY8K9zLLPVlY X-Received: by 2002:a17:907:d1f:b0:730:95c0:6cbc with SMTP id gn31-20020a1709070d1f00b0073095c06cbcmr891479ejc.395.1661388434371; Wed, 24 Aug 2022 17:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661388434; cv=none; d=google.com; s=arc-20160816; b=djMtJk6ZLVCTtCw7evhwRJqCQ7SUKQBWS5flrWZODrHuwoseMfqX5yq7+AGFHcJbqi 6lv6NzdNKcSG8Jg4pTRe4Un9qXNKx1OcvnsDdauimp4RqMv3lEhYJzrVXgBtQwbkMox0 ipIomQF1PTNWQXu5LdtBK4SILsA4I0lzPLFsReISpVHaAIedrFklY7L30sHya/LzvnwH 1maOUW77pO8SWgzllsx1H8LALUCFl2o86KjTayhINrkBziXRqb2H7YPZill4uJXoeCxW f0Wrr+hNrPKD2ARJTcBcw6N9PzkrCvJ+Ne0B2E2qXGTLO0glQuPYcXNao9GbUf4vBfeh uCAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Wpl+c4YfOpabx/QJ3AnuJKzBxyiE9VbZKz/xHkTKLAk=; b=hR6BD7cv1RBwMXqtZWp7kDoBEnuEWHlXusEhkUb4wumjmKU6cFxMg4JxTX5zrOZYVf /vE7j0vllBiD6fAn1okM0dq3pVf+myimojCPwSxm+SwdtLgqD23XXwjgMM8w94UO5Gst XsYBHUXF31wiMiCNQ2UeaiHuyz9wjZBI2LQE6HVyRswKziJBvK74gyVuoI06g8sDKR6d qqjcZEw++tCb5nhN0Yr8hHo4tzbb+08fHVXBQ8rRKmnVYTa36Jjxyklg7PLLOB1G2qGG PdN116quxlmOWhrydizPe2EHt/j+FgVQHyb7fT4qfrR+dTJa0vLcxtDv9fZYyjs5d32l 8mag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=r7iSTSO5; 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 i20-20020a1709064fd400b0073d7d28dbfcsi2940958ejw.634.2022.08.24.17.46.48; Wed, 24 Aug 2022 17:47:14 -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=20210112 header.b=r7iSTSO5; 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 S229441AbiHYAmf (ORCPT + 99 others); Wed, 24 Aug 2022 20:42:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbiHYAmc (ORCPT ); Wed, 24 Aug 2022 20:42:32 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93A1A8D3E9 for ; Wed, 24 Aug 2022 17:42:30 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id m5so14052606qkk.1 for ; Wed, 24 Aug 2022 17:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=Wpl+c4YfOpabx/QJ3AnuJKzBxyiE9VbZKz/xHkTKLAk=; b=r7iSTSO5N8EX5GHy2qXheBkYDaCDsoumn505Dy+CVk71CvcADRVPavVRi4XQL41YpW nddUiAQlihuhdYgf94AKk17bP/Lg4DS8ALSrWHJaU/mW2rCqXqPEHTnGcF9m9TMHdXX8 4ZdDcMEP7/0zTw+yec8Oo4ycG2RGwygPL66RjvWJ0nF+8FlQ21yYvGdhT+k5HKUjHdOp eRaB7I5AEZq2x2O2rCKYAM4aqUXZ31HsS+FwTsQVkUZOt6S+cZ9sCZRUVTRdDhExxG4l dP0IqFDo49hZ+tPyCYzcAt68UlxzNa6nqGWFhN7Qo8lNrdqTfwr8XombersmaWN+ksBW GsPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=Wpl+c4YfOpabx/QJ3AnuJKzBxyiE9VbZKz/xHkTKLAk=; b=AuTmZ/OrlyUEMGpy7TpNhUsJpordc1HMIvOu1MK3YZvwtwnU9S9zEShLTferusyTgv E8zyKMEZROILCzldTxQj8YiOrcwd9PTVVV50JxwtBcD3kEVnFifnRxPAc1tI4Y2jSj8l un4TsYmFRUauzJpnFYmwiO3l69t2asn0PI4sp/L6HXVve6Ui8LrD1oyYSt4DoOlRLM9p g6zs1wH1QVeFtQpaJ6/GWCw1FPDqtqotW98nxDvFOrqTrEylBGeugoeVS9+i7GFzKNQy iub7Z6UiwC9wHWAL42oIyP+5WB+D6uS6c4qF6i4owx/bUtFd2hXsRrjMap957iaTZDkU ERCQ== X-Gm-Message-State: ACgBeo3bBzrwcLmPkqRwYlSUkhl7LQ58RNVyMYtYoOVaOOrgmBV353oB lpAEI0k6r1bfzbdNwURb99rVOW0KNF2ELmqXwSvW8g== X-Received: by 2002:a37:e118:0:b0:6ba:e5ce:123b with SMTP id c24-20020a37e118000000b006bae5ce123bmr1382909qkm.221.1661388149595; Wed, 24 Aug 2022 17:42:29 -0700 (PDT) MIME-Version: 1.0 References: <20220824233117.1312810-1-haoluo@google.com> In-Reply-To: From: Hao Luo Date: Wed, 24 Aug 2022 17:42:18 -0700 Message-ID: Subject: Re: [RESEND PATCH bpf-next v9 0/5] bpf: rstat: cgroup hierarchical To: Alexei Starovoitov Cc: LKML , bpf , "open list:CONTROL GROUP (CGROUP)" , Network Development , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Tejun Heo , Zefan Li , KP Singh , Johannes Weiner , Michal Hocko , John Fastabend , Jiri Olsa , Michal Koutny , Roman Gushchin , David Rientjes , Stanislav Fomichev , Shakeel Butt , Yosry Ahmed Content-Type: text/plain; charset="UTF-8" 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 On Wed, Aug 24, 2022 at 5:29 PM Alexei Starovoitov wrote: > > On Wed, Aug 24, 2022 at 4:31 PM Hao Luo wrote: > > > > This patch series allows for using bpf to collect hierarchical cgroup > > stats efficiently by integrating with the rstat framework. The rstat > > framework provides an efficient way to collect cgroup stats percpu and > > propagate them through the cgroup hierarchy. > > > > The stats are exposed to userspace in textual form by reading files in > > bpffs, similar to cgroupfs stats by using a cgroup_iter program. > > cgroup_iter is a type of bpf_iter. It walks over cgroups in four modes: > > - walking a cgroup's descendants in pre-order. > > - walking a cgroup's descendants in post-order. > > - walking a cgroup's ancestors. > > - process only a single object. > > > > When attaching cgroup_iter, one needs to set a cgroup to the iter_link > > created from attaching. This cgroup can be passed either as a file > > descriptor or a cgroup id. That cgroup serves as the starting point of > > the walk. > > > > One can also terminate the walk early by returning 1 from the iter > > program. > > > > Note that because walking cgroup hierarchy holds cgroup_mutex, the iter > > program is called with cgroup_mutex held. > > > > ** Background on rstat for stats collection ** > > (I am using a subscriber analogy that is not commonly used) > > > > The rstat framework maintains a tree of cgroups that have updates and > > which cpus have updates. A subscriber to the rstat framework maintains > > their own stats. The framework is used to tell the subscriber when > > and what to flush, for the most efficient stats propagation. The > > workflow is as follows: > > > > - When a subscriber updates a cgroup on a cpu, it informs the rstat > > framework by calling cgroup_rstat_updated(cgrp, cpu). > > > > - When a subscriber wants to read some stats for a cgroup, it asks > > the rstat framework to initiate a stats flush (propagation) by calling > > cgroup_rstat_flush(cgrp). > > > > - When the rstat framework initiates a flush, it makes callbacks to > > subscribers to aggregate stats on cpus that have updates, and > > propagate updates to their parent. > > > > Currently, the main subscribers to the rstat framework are cgroup > > subsystems (e.g. memory, block). This patch series allow bpf programs to > > become subscribers as well. > > > > Patches in this series are organized as follows: > > * Patches 1-2 introduce cgroup_iter prog, and a selftest. > > * Patches 3-5 allow bpf programs to integrate with rstat by adding the > > necessary hook points and kfunc. A comprehensive selftest that > > demonstrates the entire workflow for using bpf and rstat to > > efficiently collect and output cgroup stats is added. > > > > --- > > Changelog: > > v8 -> v9: > > - Make UNSPEC (an invalid option) as the default order for cgroup_iter. > > - Use enum for specifying cgroup_iter order, instead of u32. > > - Add BPF_ITER_RESHCED to cgroup_iter. > > - Add cgroup_hierarchical_stats to s390x denylist. > > What 'RESEND' is for? > It seems to confuse patchwork and BPF CI. > > The v9 series made it to patchwork... > > Please just bump the version to v10 next time. > Don't add things to subject, since automation cannot recognize > that yet. Sorry about that. I thought it was RESEND because no content has changed. It was just adding an entry in s390 denylist. Are we good now? Or I need to send a v10?