-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
posix: SCHED_RR valid thread priorities #56729
Labels
area: POSIX
POSIX API Library
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Comments
cfriedt
added a commit
to cfriedt/zephyr
that referenced
this issue
Apr 25, 2023
Previously, there was an off-by-one error for SCHED_RR. Fixes zephyrproject-rtos#56729 Signed-off-by: Chris Friedt <[email protected]>
cfriedt
added a commit
to cfriedt/zephyr
that referenced
this issue
Apr 29, 2023
Verify that threads are actually schedulable for min and max scheduler priority for both `SCHED_RR` (preemptive) and `SCHED_FIFO` (cooperative). Fixes zephyrproject-rtos#56729 Signed-off-by: Chris Friedt <[email protected]>
jgl-meta
pushed a commit
that referenced
this issue
Apr 29, 2023
Previously, there was an off-by-one error for SCHED_RR. Fixes #56729 Signed-off-by: Chris Friedt <[email protected]>
jgl-meta
pushed a commit
that referenced
this issue
Apr 29, 2023
Verify that threads are actually schedulable for min and max scheduler priority for both `SCHED_RR` (preemptive) and `SCHED_FIFO` (cooperative). Fixes #56729 Signed-off-by: Chris Friedt <[email protected]>
cfriedt
added a commit
that referenced
this issue
Apr 30, 2023
Previously, there was an off-by-one error for SCHED_RR. Fixes #56729 Signed-off-by: Chris Friedt <[email protected]> (cherry picked from commit 2b2cbf8)
This was referenced Apr 30, 2023
cfriedt
added a commit
that referenced
this issue
Apr 30, 2023
Verify that threads are actually schedulable for min and max scheduler priority for both `SCHED_RR` (preemptive) and `SCHED_FIFO` (cooperative). Fixes #56729 Signed-off-by: Chris Friedt <[email protected]> (cherry picked from commit ad71b78)
cfriedt
added a commit
that referenced
this issue
May 2, 2023
Previously, there was an off-by-one error for SCHED_RR. Fixes #56729 Signed-off-by: Chris Friedt <[email protected]> (cherry picked from commit 2b2cbf8)
cfriedt
added a commit
that referenced
this issue
May 2, 2023
Verify that threads are actually schedulable for min and max scheduler priority for both `SCHED_RR` (preemptive) and `SCHED_FIFO` (cooperative). Fixes #56729 Signed-off-by: Chris Friedt <[email protected]> (cherry picked from commit ad71b78)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: POSIX
POSIX API Library
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
Zephyr does not correctly advertize the minimum acceptable priority value that can be used with its posix threads when using
SCHED_RR
.Calling
sched_get_priority_min
returns 0:zephyr/lib/posix/pthread_sched.c
Line 39 in d5f83d2
But looking at
posix_to_zephyr_priority
(used bypthread_create
), 0 is not an acceptable value as it translates to a Zephyr thread priority ofCONFIG_NUM_PREEMPT_PRIORITIES
:zephyr/lib/posix/pthread.c
Line 92 in d5f83d2
zephyr/kernel/thread.c
Line 536 in d5f83d2
Note that the priority set by
pthread_attr_init
is 1, so it isn't an issue when leaving the default thread priority. But this value looks arbitrary:zephyr/lib/posix/pthread.c
Line 21 in d5f83d2
To Reproduce
Steps to reproduce the behavior:
CONFIG_PREEMPT_ENABLED=y
in order to getSCHED_RR
.CONFIG_ZTEST=y
in order to get the kernel asserts.Expected behavior
No assert failed when using a priority advertized by Zephyr as being valid.
Impact
Annoyance
Logs and console output
With
CONFIG_NUM_PREEMPT_PRIORITIES=15
:Environment (please complete the following information):
Tested on tag zephyr-v3.3.0, looks still relevant on tip of main as of the time of writing.
Additional context
N/A
cc @PatrickM-ZS
The text was updated successfully, but these errors were encountered: