On Tue, Apr 29, 2025 at 05:28:59PM -0700, Suren Baghdasaryan wrote: > On Sun, Apr 27, 2025 at 8:37 PM Roman Gushchin <roman.gushchin@xxxxxxxxx> wrote: > > > > Introduce a bpf hook to handle psi events. The primary intended > > purpose of this hook is to declare OOM events based on the reaching > > a certain memory pressure level, similar to what systemd-oomd and oomd > > are doing in userspace. > > It's a bit awkward that this requires additional userspace action to > create PSI triggers. I have almost no experience with BPF, so this > might be a stupid question, but maybe we could provide a bpf kfunc for > the BPF handler to register its PSI trigger(s) upon handler > registration? It looks like it's doable using struct_ops path: the .init callback can create psi triggers and "attach" them to the loaded bpf program. But I need to figure out the details. Good point, thank you!