-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add back preadv2
optimization for try_acquire
on Linux
#90
base: main
Are you sure you want to change the base?
Add back preadv2
optimization for try_acquire
on Linux
#90
Conversation
cc @the8472 can you check the syscall I added please? I'm not sure if it is correct, thank you! |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
5a43208
to
c65cd8e
Compare
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can simplify things by limiting to aarch64, x86_64 linux gnu? Those are probably the most common environments where stuff is built. And it's mostly a perf optimization, so we can be conservative in which platforms get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the numbers on this optimization like?
It would enable
On performance, it's mostly for avoiding performance loss with Without |
Well, from the glibc implementation, it looks like there're only 3 versions for it, so maybe we can still bare with the cost?
While it's mostly a perf optimization, there is situation where
|
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Thanks @NobodyXu for the work. Believing that people already know the benefit of this for fixing unsupported situations. What Jubilee asked for are numbers. I think that's a reasonable request for a change aiming at optimization. Could you do some benchmark and show the number, so we can have a baseline in mind? It is also beneficial to prevent from future performance regression if we have the reproducible benchmark steps (if you don't mind sharing). |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
ab7b8db
to
5cf22b5
Compare
Co-authored-by: Jubilee Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
I could add one in Edit: Would do that tomorrow. |
Note that using blocking reads in acquire is mostly beneficial when there are many concurrent waiters. A single waiter won't see much of a speedup (perhaps a little from the avoided syscalls). See #30 and torvalds/linux@0ddad21, the latter one has numbers. |
Oh, cute, so it is in fact a kernel optimization specifically for this protocol! |
Can the code generally minimize amount of |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Thanks, I've added the code in |
Fixed #87