Browse Source

sched: remove restriction on single-tick time slices

Slice expirations are now based on the same timeout mechanism as
regular timers which have been recently fixed and proven to work with
single-tick periods.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
pull/54466/head
Nicolas Pitre 2 years ago committed by Anas Nashif
parent
commit
405611dc9e
  1. 6
      kernel/sched.c

6
kernel/sched.c

@ -484,12 +484,6 @@ void k_sched_time_slice_set(int32_t slice, int prio) @@ -484,12 +484,6 @@ void k_sched_time_slice_set(int32_t slice, int prio)
{
LOCKED(&sched_spinlock) {
slice_ticks = k_ms_to_ticks_ceil32(slice);
if (IS_ENABLED(CONFIG_TICKLESS_KERNEL) && slice > 0) {
/* It's not possible to reliably set a 1-tick
* timeout if ticks aren't regular.
*/
slice_ticks = MAX(2, slice_ticks);
}
slice_max_prio = prio;
z_reset_time_slice(_current);
}

Loading…
Cancel
Save