Skip to content
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

linux/concepts: fix a mistake on atomics return value #112

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

mtardy
Copy link
Member

@mtardy mtardy commented Jan 13, 2025

See more details in the specification1:

The BPF_FETCH modifier is optional for simple atomic operations, and
always set for the complex atomic operations. If the BPF_FETCH flag is set, then the operation also overwrites src with the value that was in memory before it was modified.

Note that we could be even more explicit like they do with something like: "value that was in memory before it was modified".

Footnotes

  1. https://www.kernel.org/doc/html/v6.5/bpf/instruction-set.html#atomic-operations

See more details in the specification[^0]:
> The BPF_FETCH modifier is optional for simple atomic operations, and
always set for the complex atomic operations. If the BPF_FETCH flag is
set, then the operation also overwrites src with the value that was in
memory before it was modified.

[^0]: https://www.kernel.org/doc/html/v6.5/bpf/instruction-set.html#atomic-operations

Signed-off-by: Mahe Tardy <[email protected]>
@mtardy mtardy added the correction Correction of spelling, grammar, or content label Jan 13, 2025
Copy link
Collaborator

@dylandreimerink dylandreimerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks! 🚀

@dylandreimerink dylandreimerink merged commit 10d4248 into master Jan 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
correction Correction of spelling, grammar, or content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants