lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 24 Aug 2022 17:48:35 -0700
From:   Hao Luo <haoluo@...gle.com>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        "open list:CONTROL GROUP (CGROUP)" <cgroups@...r.kernel.org>,
        Network Development <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Andrii Nakryiko <andrii@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Martin KaFai Lau <martin.lau@...ux.dev>,
        Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
        Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
        KP Singh <kpsingh@...nel.org>,
        Johannes Weiner <hannes@...xchg.org>,
        Michal Hocko <mhocko@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        Jiri Olsa <jolsa@...nel.org>, Michal Koutny <mkoutny@...e.com>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        David Rientjes <rientjes@...gle.com>,
        Stanislav Fomichev <sdf@...gle.com>,
        Shakeel Butt <shakeelb@...gle.com>,
        Yosry Ahmed <yosryahmed@...gle.com>
Subject: Re: [RESEND PATCH bpf-next v9 0/5] bpf: rstat: cgroup hierarchical

On Wed, Aug 24, 2022 at 5:47 PM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Wed, Aug 24, 2022 at 5:42 PM Hao Luo <haoluo@...gle.com> wrote:
> >
> > On Wed, Aug 24, 2022 at 5:29 PM Alexei Starovoitov
> > <alexei.starovoitov@...il.com> wrote:
> > >
> > > On Wed, Aug 24, 2022 at 4:31 PM Hao Luo <haoluo@...gle.com> 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?
>
> No need. Assuming that 'RESEND' version will be green in CI.

Sounds good. I will monitor the CI. :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ