BPF Concurrency

Kanthi P <Pavuluri.kanthi@...>


I’ve been reading that hash map’s update element is atomic and also that we can use BPF_XADD to make the entire map update atomically.

But I think that doesn’t guarantee that these updates are thread safe, meaning one cpu core can overwrite other core’s update.

Is there a clean way of keeping them thread safe. Unfortunately I can’t use per-cpu maps as I need global counters.

And spin locks sounds a costly operation. Can you please throw some light?



Join iovisor-dev@lists.iovisor.org to automatically receive all group messages.