Same binary with or without a line #793
-
I was trying something out based on this. Adding this line: e->ioprio = IORING_RECVSEND_POLL_FIRST; to the back tier of my C++ code generator doesn't seem to change anything with my executable. The before and after versions are the same size and running cmp on them says they're the same. I've tried building both ways and doing the cmp again but there's no difference. I'm using Fedora rawhide 6.2.0-0.rc8.57 and clang 15.0.7 with -std=c++2b -0z when building. For context what I'm trying is very similar to the line I added in this change(Ebenezer-group/onwards@f09d1f3) to the C++ source file. In that case, the size of the executable increases by 10 bytes. This is the function in the last link:
Commenting out line 1 leads to same size and no difference with cmp. Any ideas on this? Thanks. Also I think I'm of the opinion that this should be the default behavior and you shouldn't have to turn it on like this. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
I want to add that the above function is from the open source part of my project. I'm using essentially the same function in the closed source part of my code. And am only having this (problem?) in the closed source part. In the open source part, the binary gets a little bigger with the additional line. |
Beta Was this translation helpful? Give feedback.
-
Something is going on here which isn't a liburing/io_uring thing. Either your change is behind some define or whatnot that means that it doesn't get compiled either way, or the compiler figures out it's unused and it's not in the executable anyway. Or it's a build issue, your file isn't getting rebuilt for whatever reasons. It's 100% certain that the above change would result in a different binary UNLESS the compiler isn't compiling it... |
Beta Was this translation helpful? Give feedback.
-
Could it be that because |
Beta Was this translation helpful? Give feedback.
-
Oh that's a mighty good point, that is totally what it is. Why keep the = 1 if you clear it afterwards anyway... |
Beta Was this translation helpful? Give feedback.
-
I guess setting the value has to follow the call to io_uring_prep_recv. |
Beta Was this translation helpful? Give feedback.
-
Am 17.02.23 um 19:53 schrieb Ebenezer-group:
I was trying something out based on [this](https://www.reddit.com/r/programming/comments/112rx1m/io_uring_and_networking_in_2023/). Adding this line:
e->ioprio = IORING_RECVSEND_POLL_FIRST;
to the back tier of my C++ code generator doesn't seem to change anything with my executable. The before and after versions are the same size and running _cmp_ on them says they're the same. I've tried building both ways and doing the cmp again but there's no difference. I'm using Fedora rawhide 6.2.0-0.rc8.57 and clang 15.0.7 with -std=c++2b -0z when building. For context what I'm trying is very similar to the line I added in [this change](url)(Ebenezer-group/onwards@f09d1f3) to the C++ source file. In that case, the size of the executable increases by 10 bytes.
This is the function in the last link:
```
void reed (){
auto e=getSqe();
e->ioprio=IORING_RECVSEND_POLL_FIRST; // 1
auto sp=cmwBuf.getDuo();
::io_uring_prep_recv(e,cmwBuf.sock_,sp.data(),sp.size(),0);
::io_uring_sqe_set_data64(e,reedTag); // 2
}
```
Commenting out line 1 leads to same size and no difference with cmp.
Commenting out line 2 leads to same size, but a difference with cmp.
Any ideas on this? Thanks.
Also I think I'm of the opinion that this should be the default behavior and you shouldn't have to turn it on like this.
e->ioprio=IORING_RECVSEND_POLL_FIRST; must be after io_uring_prep_recv(),
as io_uring_prep_recv clears it again...
|
Beta Was this translation helpful? Give feedback.
-
On Sat, Feb 18, 2023 at 12:44 AM metze-samba ***@***.***> wrote:
Am 17.02.23 um 19:53 schrieb Ebenezer-group:
> I was trying something out based on [this](
https://www.reddit.com/r/programming/comments/112rx1m/io_uring_and_networking_in_2023/).
Adding this line:
>
> e->ioprio = IORING_RECVSEND_POLL_FIRST;
>
> to the back tier of my C++ code generator doesn't seem to change
anything with my executable. The before and after versions are the same
size and running _cmp_ on them says they're the same. I've tried building
both ways and doing the cmp again but there's no difference. I'm using
Fedora rawhide 6.2.0-0.rc8.57 and clang 15.0.7 with -std=c++2b -0z when
building. For context what I'm trying is very similar to the line I added
in [this change](url)(
Ebenezer-group/onwards@f09d1f3)
to the C++ source file. In that case, the size of the executable increases
by 10 bytes.
>
> This is the function in the last link:
>
> ```
> void reed (){
> auto e=getSqe();
> e->ioprio=IORING_RECVSEND_POLL_FIRST; // 1
> auto sp=cmwBuf.getDuo();
> ::io_uring_prep_recv(e,cmwBuf.sock_,sp.data(),sp.size(),0);
> ::io_uring_sqe_set_data64(e,reedTag); // 2
> }
> ```
>
> Commenting out line 1 leads to same size and no difference with cmp.
> Commenting out line 2 leads to same size, but a difference with cmp.
>
> Any ideas on this? Thanks.
>
> Also I think I'm of the opinion that this should be the default behavior
and you shouldn't have to turn it on like this.
e->ioprio=IORING_RECVSEND_POLL_FIRST; must be after io_uring_prep_recv(),
as io_uring_prep_recv clears it again...
Thanks, yeah I realized that yesterday after reading the other replies. I
tried to mark Frank's
reply as the answer but am not sure if that worked.
… Message ID: ***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
Could it be that because
io_uring_prep_recv
sets the e->ioprio to zero, anything it was set to before doesn't matter and the compiler even removes the code? Try moving that line to be last and see if you get the results you were expecting.