libc icon indicating copy to clipboard operation
libc copied to clipboard

Add SO_PREFER_BUSY_POLL and SO_BUSY_POLL_BUDGET

Open tammela opened this issue 1 year ago • 6 comments

Remove the comment of these socket options. Reference: https://elixir.bootlin.com/linux/latest/source/include/uapi/asm-generic/socket.h

tammela avatar Sep 11 '24 19:09 tammela

r? @tgross35

rustbot has assigned @tgross35. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot avatar Sep 11 '24 19:09 rustbot

From the CI results (i686-unknown-linux-musl) it seems like the machine does not have a uapi header with the constant. They were added in 5.11 and the sanitized headers are in 4.19: https://github.com/rust-lang/libc/blob/main/ci/install-musl.sh#L68

tammela avatar Sep 11 '24 20:09 tammela

for the time being, need to add those constants as exception (for CI), as if musl then ignore those two.

devnexen avatar Sep 11 '24 20:09 devnexen

@devnexen Got it. I was wondering if someone tried to update the kernel headers for the musl CI. Alpine uses musl as well and they don't seem to use sabotage-linux headers but rather roll their own (currently targeting 6.6 soon to be 6.10): https://git.alpinelinux.org/aports/tree/main/linux-headers?h=master

tammela avatar Sep 12 '24 13:09 tammela

I updated the CI to use the alpine headers here: https://github.com/tammela/libc/commit/17af7ba240f5deda442b126ae56b4a2937e6f8bc

Seems to be passing the CI scripts, let me know if it's worth the shot and I can open up a PR

tammela avatar Sep 12 '24 18:09 tammela

nice, it might be best to create a PR for this musl update alone tough. cc @tgross35

devnexen avatar Sep 12 '24 18:09 devnexen

Needs this one to pass CI: https://github.com/rust-lang/libc/pull/3921

tammela avatar Sep 30 '24 17:09 tammela

I will double check CI

tammela avatar Nov 21 '24 21:11 tammela

So musl for some reason hard codes the socket constants instead of fetching them from the OS: https://git.musl-libc.org/cgit/musl/tree/include/sys/socket.h#n293

I will look for a way to test these constants only on gnu libc

tammela avatar Nov 21 '24 23:11 tammela

:umbrella: The latest upstream changes (presumably #4132) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Nov 27 '24 00:11 bors

It looks like CI is passing - is this ready to be merged or is there something else to be done? (I've held off because of the labels)

tgross35 avatar Nov 27 '24 17:11 tgross35

It looks like CI is passing - is this ready to be merged or is there something else to be done? (I've held off because of the labels)

I gave in and gated the new constants for !musl. So it should be good from my side. Musl made the decision to hardcode the SO_ constants instead of inherit them from the OS via #include <asm-generic/socket.h>. Essentially updating the kernel headers is not enough, you have to hope a recent musl version kept up with the new constants... The next musl version update will likely fill in the gap (till 70), but linux already added a bunch more :)

tammela avatar Nov 27 '24 17:11 tammela

Thanks!

tgross35 avatar Mar 04 '25 21:03 tgross35