All of lore.kernel.org
 help / color / mirror / Atom feed
* XDP/eBPF map thread safety in kernel (e.g. lookup/delete)
@ 2024-10-23 11:54 Vadim Goncharov
  2024-10-23 12:10 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 5+ messages in thread
From: Vadim Goncharov @ 2024-10-23 11:54 UTC (permalink / raw)
  To: xdp-newbies

Hello,

Where to find exact documentation about what happens in kernel BPF
helpers calls with respect to locking? For example, I have
`bpf_map_lookup_elem()` in one thread, then work on pointer, and at this
time, another thread does `bpf_map_delete_elem()` for exactly same key.
What happens to memory the first thread still continue to work on? Is
it now dangling pointer to nowhere?

In my particular case it's a bpf_timer callback who does
`bpf_map_delete_elem()`. I'd prefer for it to not delete entry if
another thread did `lookup` and works already, is it possible to do so
(in a performant way)?

-- 
WBR, @nuclight

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-25 11:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 11:54 XDP/eBPF map thread safety in kernel (e.g. lookup/delete) Vadim Goncharov
2024-10-23 12:10 ` Toke Høiland-Jørgensen
2024-10-23 12:31   ` Vadim Goncharov
     [not found]   ` <20241023152810.42936dc4@nuclight.lan>
     [not found]     ` <875xphftdq.fsf@toke.dk>
2024-10-24 21:18       ` Vadim Goncharov
2024-10-25 11:06         ` Toke Høiland-Jørgensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.