[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJuCfpGGAEh0pnbp8jA+0LgdT5k5qtGthJQopHZz9vzXZ8KQ1w@mail.gmail.com>
Date: Wed, 20 Aug 2025 16:56:01 -0700
From: Suren Baghdasaryan <surenb@...gle.com>
To: Roman Gushchin <roman.gushchin@...ux.dev>
Cc: linux-mm@...ck.org, bpf@...r.kernel.org,
Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...e.com>,
David Rientjes <rientjes@...gle.com>, Matt Bobrowski <mattbobrowski@...gle.com>,
Song Liu <song@...nel.org>, Kumar Kartikeya Dwivedi <memxor@...il.com>, Alexei Starovoitov <ast@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 12/14] sched: psi: implement psi trigger handling using bpf
On Tue, Aug 19, 2025 at 4:31 PM Roman Gushchin <roman.gushchin@...ux.dev> wrote:
>
> Roman Gushchin <roman.gushchin@...ux.dev> writes:
>
> > Suren Baghdasaryan <surenb@...gle.com> writes:
> >
> >> On Mon, Aug 18, 2025 at 10:02 AM Roman Gushchin
> >> <roman.gushchin@...ux.dev> 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.
Ok, I obviously missed some important relations between these
structures. Let me digest it some more before commenting further.
Powered by blists - more mailing lists