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] [day] [month] [year] [list]
Message-ID: <87cy4otof1.fsf@linux.dev>
Date: Mon, 08 Dec 2025 17:49:22 -0800
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: hui.zhu@...ux.dev
Cc: "Andrew Morton" <akpm@...ux-foundation.org>,
  linux-kernel@...r.kernel.org,  "Alexei Starovoitov" <ast@...nel.org>,
  "Suren Baghdasaryan" <surenb@...gle.com>,  "Michal Hocko"
 <mhocko@...nel.org>,  "Shakeel Butt" <shakeel.butt@...ux.dev>,  "Johannes
 Weiner" <hannes@...xchg.org>,  "Andrii Nakryiko" <andrii@...nel.org>,  "JP
 Kobryn" <inwardvessel@...il.com>,  linux-mm@...ck.org,
  cgroups@...r.kernel.org,  bpf@...r.kernel.org,  "Martin KaFai Lau"
 <martin.lau@...nel.org>,  "Song Liu" <song@...nel.org>,  "Kumar Kartikeya
 Dwivedi" <memxor@...il.com>,  "Tejun Heo" <tj@...nel.org>
Subject: Re: [PATCH v2 21/23] sched: psi: implement bpf_psi_create_trigger()
  kfunc

hui.zhu@...ux.dev writes:

> 2025年10月28日 07:22, "Roman Gushchin" <roman.gushchin@...ux.dev
> mailto:roman.gushchin@...ux.dev?to=%22Roman%20Gushchin%22%20%3Croman.gushchin%40linux.dev%3E
>> 写到:
>
>
>> 
>> Implement a new bpf_psi_create_trigger() BPF kfunc, which allows
>> to create new PSI triggers and attach them to cgroups or be
>> system-wide.
>> 
>> Created triggers will exist until the struct ops is loaded and
>> if they are attached to a cgroup until the cgroup exists.
>> 
>> Due to a limitation of 5 arguments, the resource type and the "full"
>> bit are squeezed into a single u32.
>> 
>> Signed-off-by: Roman Gushchin <roman.gushchin@...ux.dev>
>
> Hi Roman,
>
> I wrote an eBPF program attempting to use bpf_psi struct ops and
> bpf_psi_create_trigger to continuously receive memory-related PSI
> events, but I only received one event.
>
> Looking at the code implementation, when an event occurs:
> if (cmpxchg(&t->event, 0, 1) == 0) {
>
> However, in eBPF there appears to be no way to call the equivalent
> of this code from psi_trigger_poll:
> if (cmpxchg(&t->event, 1, 0) == 1)
> to reset the event back to 0.
>
> Would it be possible to add an additional BPF helper function to
> handle this? Without a way to acknowledge/reset the event flag,
> the trigger only fires once and cannot be reused for continuous
> monitoring.

Hi Hui,

Good point. I'll add something in v3, which I'm working on, if I'm going
to preserve the bpf psi infrastructure in the current form. An
alternative approach suggested by Tejun was to use a simple tracepoint
and implement the rest in BPF - something I'm exploring right now.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ