-
Notifications
You must be signed in to change notification settings - Fork 2k
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
core/msg: yield after thread_flags_wake() in queue_msg() #16899
core/msg: yield after thread_flags_wake() in queue_msg() #16899
Conversation
@jia200x could you run your test on this one? |
Ouch. :) |
Sure! Let's see |
|
I think #16754 should fix this |
This is triggered when using #16748. I can rebase again and see if the warnings are gone |
Then I guess it's fixed |
0347476
to
0c87335
Compare
@OlegHahm should we backport this? |
To be honest, I'm somewhat reluctant to merge a kernel patch that late in the process. On the other hand a kernel bug is a kernel bug... Under which circumstances will the described bug occur? |
It occurs if a thread sits waiting for multiple flags including THREAD_FLAG_MSG_WAITING (using |
Contribution description
Alternative version of #16751, doesn't require changing
thread_yield_higher()
semantics.Without this fix, it is possible that a thread got set to "PENDING"
after being woken up by a message flag, but no scheduling gets
triggered.
thread_flag_wake()
(called byqueue_msg()
) does setsched_context_switch_request=1
, which in all other casesin msg.c will be used to conditionally call
thread_yield_higher()
.This PR adds the missing case in
_msg_send()
.Testing procedure
Issues/PRs references
#16751