tests: test for prio inversion using msg_send_recv#9306
tests: test for prio inversion using msg_send_recv#9306haukepetersen wants to merge 1 commit intoRIOT-OS:masterfrom
Conversation
| Event 3: t1 - sending msg to t3 (msg_send_receive) | ||
| Event 4: t3 - received message | ||
| Event 5: t3 - sending reply | ||
| Event 6: t1 - received reply |
There was a problem hiding this comment.
I reckon this is starvation, rather than priority inversion. Reason is that the medium priority thread prevents the low thread from running even before the message is sent, rather than pre-empting it while it's handling the message. Priority inversion would involve the second one - i.e. indirect pre-emption of a higher priority thread.
An example displaying priority inversion with messages would involve the high thread sending the message to the low thread, and the low thread receiving it and doing some action before sending. But while that action is happening, the medium thread comes along and pre-empts the low thread.
There was a problem hiding this comment.
yes, will fix.
| puts("TEST OUTPUT:"); | ||
|
|
||
| /* create threads */ | ||
| for (unsigned i = 0; i < T_NUMOF; i++) { |
There was a problem hiding this comment.
IMO separating out three "high", "medium" and "low" named threads was nicer for readability.
| return NULL; | ||
| } | ||
|
|
||
| static thread_task_func_t _handlers[] = { t1, t2, t3 }; |
There was a problem hiding this comment.
This might fit better at the top, next to _names? Or at least the two together?
There was a problem hiding this comment.
its a tradeoff, having it here means that I was able to skip the forward declaration of the thread functions...
|
NB I've differentiated between "review changes" and "suggestions". I.e. between saying, "this should be changed", and just giving feedback, to be changed if desired. Is this clear in the way I've done it? |
b8c7968 to
6d819e6
Compare
|
fixed style issues, looking into the starvation vs inversion problem next |
|
changed the test slightly, should now actually test for prio inversion instead of prio starvation, right? In the end IMHO it does not really matter, as both versions break without any counter measures, and both versions are fixed with priority inheritance enabled, so they should actually test for very similar behavior. |
| Test for showing priority inversion when using msg_send_receive | ||
|
|
||
| If this tests succeeds, you should see 6 events appearing in order. | ||
| The expected output should look like this: |
There was a problem hiding this comment.
Could you please change the readme to reflect the recent changes in the test?
e773877 to
7c857e5
Compare
|
fixed the README and squashed. |
7c857e5 to
6762d07
Compare
|
fixed board blacklisting and squashed. |
6762d07 to
465f0c7
Compare
|
fixed one more little pep issue in the testrunner script |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
|
Since this PR has been stale for several years, I'll convert it to a draft. Please feel free to remove the draft state if anyone wants to pick this up again. |
Contribution description
#7445 also introduces priority inheritance for
msg_send_receivecalls. This PR adds a test showcasing priority inversion formsg_send_receive, cutting it from #7445 for simpler reviewing...Issues/PRs references
Cut out from #7445 and similar to #7444