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?