Roman Gushchin <roman.gushchin@xxxxxxxxx> writes: > Suren Baghdasaryan <surenb@xxxxxxxxxx> writes: > >> On Mon, Aug 18, 2025 at 10:02 AM Roman Gushchin >> <roman.gushchin@xxxxxxxxx> wrote: > >> >>> + >>> + /* Cgroup Id */ >>> + u64 cgroup_id; >> >> This cgroup_id field is weird. It's not initialized and not used here, >> then it gets initialized in the next patch and used in the last patch >> from a selftest. This is quite confusing. Also logically I don't think >> a cgroup attribute really belongs to psi_trigger... Can we at least >> move it into bpf_psi where it might fit a bit better? > > I can't move it to bpf_psi, because a single bpf_psi might own multiple > triggers with different cgroup_id's. > For sure I can move it to the next patch, if it's preferred. > > If you really don't like it here, other option is to replace it with > a new bpf helper (kfunc) which calculates the cgroup_id by walking the > trigger->group->cgroup->cgroup_id path each time. Actually there is no easy path from psi_group to cgroup, so there is no such option available, unfortunately. Or we need a back-link from the psi_group to cgroup.