-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
kernel: pipe: if timeout is not K_NO_WAIT and >= min_xfer bytes transferred, then return immediately #24486
kernel: pipe: if timeout is not K_NO_WAIT and >= min_xfer bytes transferred, then return immediately #24486
Conversation
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
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.
This looks correct to me. My one complaint is that's special casing K_FOREVER when, as I see it, we should be treating the timeout symmetrically. That is, our behavior is wrong for non-zero finite timeouts too, and we should fix that at the same time. I'm pretty sure it's just the change to the conditional.
And we should probably add a test of this behavior too..
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.
Looks great to me, thanks.
@andyross - any idea what is up with Shippable? It looks like some invalid memory accesses are happening, particularly in case 4. I'm also encountering something similar with my implementation of socketpair(2) (which does not include this change). AFAICT, I'm just using the Does it seem like something else is up with |
I've created another issue (#24642) that demonstrates the issue on master. |
They can, but not in userspace threads. Also there may be a mode coming soon for cache-incoherent multiprocessors where the local stack will be cached where IPC data will be placed in uncached regions by default. But yeah, it's virtually always best to declare these things statically using the existing initializer macros. |
Ah, I see. |
@nashif this is timing out, should we merge directly? |
close/reopen to kick CI again |
@cfriedt the timeout is related to your change, please see why tests/benchmarks/app_kernel is hanging with native_posix...
|
or |
Same here, I just checked and the test hangs forever as well when using this PR vs master |
On the other hand, the test you modified passes correctly:
|
To be clear: we've had a nontrivial number of situations where tests have been written to demand what seems like genuinely buggy behavior. Ping me if you get stuck. I promise I'm personally convinced this behavior is what we want. |
@cfriedt it seems stuck in
|
It might well be that this PR needs to come with a change to |
Interesting - thanks for looking at this test case everyone. From the stack trace @carlescufi provided, it looks as though If I think the fix is to just add the extra condition Let me update the PR. |
If timeout != K_NO_WAIT, then return immediately when not all bytes_to_read or bytes_to_write have been transfered, but >= min_xfer have been transferred. Fixes #24485 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Ignore this comment, I had not refreshed the page. Merging now. |
If
timeout != K_NO_WAIT
, then return immediately when not allbytes_to_read
/bytes_to_write
have been transfered, but>= min_xfer
have been transferred.Fixes #24485