-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition in map loop for BPF_MAP_TYPE_PERCPU_HASH #3117
Comments
It looks like the problem occurs when the
Same CPU, correct result:
Different CPU, wrong result:
|
Maybe #3126 is the solution for this bug as well? When reading a per-cpu map value, collect data from all CPUs. |
Yeah that makes sense. I'll try to pick up that task soon (if no one beats me to it). |
This is fixed here: #3189 |
This script seems to always exit with the correct output, namely:
(1, 100)
.However if you use the
count()
function instead of+=1
, which is functionally equivalent, I often see this as the output:(1,0)
.My guess is that because the map used for
count
isBPF_MAP_TYPE_PERCPU_HASH
vsBPF_MAP_TYPE_HASH
used for the+=
operation, there is some issue there but that's as far as I got.The text was updated successfully, but these errors were encountered: