lkml.org 
[lkml]   [2022]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH bpf-next v5 4/8] bpf: Introduce cgroup iter
    Hello,

    On Fri, Jul 22, 2022 at 05:48:25PM +0000, Yosry Ahmed wrote:
    > +
    > + /* cgroup_iter walks either the live descendants of a cgroup subtree, or the
    > + * ancestors of a given cgroup.
    > + */
    > + struct {
    > + /* Cgroup file descriptor. This is root of the subtree if walking
    > + * descendants; it's the starting cgroup if walking the ancestors.
    > + * If it is left 0, the traversal starts from the default cgroup v2
    > + * root. For walking v1 hierarchy, one should always explicitly
    > + * specify the cgroup_fd.
    > + */
    > + __u32 cgroup_fd;

    So, we're identifying the starting point with an fd.

    > + __u32 traversal_order;
    > + } cgroup;
    > };
    >
    > /* BPF syscall commands, see bpf(2) man-page for more details. */
    > @@ -6136,6 +6156,16 @@ struct bpf_link_info {
    > __u32 map_id;
    > } map;
    > };
    > + union {
    > + struct {
    > + __u64 cgroup_id;
    > + __u32 traversal_order;
    > + } cgroup;

    but iterating the IDs. IDs are the better choice for cgroup2 as there's
    nothing specific to the calling program or the fds it has, but I guess this
    is because you want to use it for cgroup1, right? Oh well, that's okay I
    guess.

    Acked-by: Tejun Heo <tj@kernel.org>

    Thanks.

    --
    tejun
    \
     
     \ /
      Last update: 2022-07-28 18:51    [W:2.959 / U:0.376 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site