-
Notifications
You must be signed in to change notification settings - Fork 200
scx_rusty: arena library backports #2017
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
Conversation
|
Yes, the arena code in rusty has been copied off of the main library, so this is essentially a backport. This includes recomputing the padding. Do you mind if I rename the pull request as "scx_rusty: arena library backports" for clarity? |
Yes, renaming is clearer. |
4836036 to
7df7724
Compare
|
Oh I guess we had not added the padding feature to the allocator when we forked off the code, in that cases the padding is always 0 so it is not necessary. |
7df7724 to
a6032ca
Compare
OK, I've cleaned up the commit message, PTAL thanks! |
Add a check for failed allocation when calling sdt_alloc(). Ref: 9649028 Co-authored-by: Po-Ying Chiu <charlie910417@gmail.com> Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Check `memory` instead of `scx_static.memory` after arena allocation. Ref: 99b2c79 Co-authored-by: Po-Ying Chiu <charlie910417@gmail.com> Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Ref: ece44e4 Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Add a missing `bpf_spin_unlock(&sdt_lock)` before returning the allocated pointer to ensure the lock is always released on the normal path. Co-authored-by: Po-Ying Chiu <charlie910417@gmail.com> Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
When the static allocator runs out of space it now allocates a fresh arena block, resets the offset to zero. Ref: 8d8a85d Co-authored-by: Po-Ying Chiu <charlie910417@gmail.com> Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
a6032ca to
0006e57
Compare
|
Thank you! I'll take another look. |
Here are the changes I made:
[RFC] Recompute padding on allocation$\to$ should this align with *scx_static_alloc(size_t bytes, size_t alignment)?Edit: