Open justicezyx opened 3 years ago
Since different data structures implement the 'BPF map operations' interface, I don't think any atomicity guarantees that are consistent across the board can be made. Is there a specific map type you're interested in?
Regardless, many of these map impls use RCU under the hood to synchronize reads and writes, so your speculation
that the race condition might causes we read stale values, or missing values, but the data structure can still be navigated correctly
sounds correct for these cases.
Is there a specific map type you're interested in?
I am looking at BPF_HASH().
We uses BPF map to transfer data from BPF to userspace. The code calls get_table_offline() to get all data. But we are concerned about the race condition, between the userspace code and the bpf code, as during the call of get_table_offline(), the bpf map is still being written by BPF code.
But so far we have not observed fatal breakage at all.
We speculated that the race condition might causes we read stale values, or missing values, but the data structure can still be navigated correctly.
Is there more detailed description of the atomicity of get_table_offline()?