Re: [tsc] Re: why zephyer os did not support RR-Schedule policy between same priority task?


Nashif, Anas
 

Moving this to the devel@ mailing list.

The relevant jira: https://jira.zephyrproject.org/browse/ZEP-948

Anas

-----Original Message-----
From: Benjamin Walsh [mailto:benjamin.walsh(a)windriver.com]
Sent: Friday, January 20, 2017 11:31 AM
To: 曹子龙 <13824125580(a)163.com>
Cc: Nashif, Anas <anas.nashif(a)intel.com>; tsc(a)lists.zephyrproject.org
Subject: Re: [tsc] Re: why zephyer os did not support RR-Schedule policy between same priority task?

i review the zephyr os core code about the schedule policy, and i
am not sure if it is right about what i said next, i found that
zephyr not support the the Round-Robin schedule policy which many
rtos adopted between two or more identical prio tasks, so i
thinks this may bring some trouble for application user ,because
they must know when and where to yield the cpu to another task
with same priority because the scheduler cant do that, am i right ?

appreciate your kindly help for my puzzle. :)
Look at

https://www.zephyrproject.org/doc/introduction/introducing_zephyr.ht
ml

round robin is supported already with the following option:

config TIMESLICING
bool "Thread time slicing"
default y
depends on SYS_CLOCK_EXISTS && (NUM_PREEMPT_PRIORITIES != 0)
help
This option enables time slicing between preemptible threads of
equal priority.
but seems that the RR policy zephyr used, the time slice is
applied to the scheduler not each thread, is it? because i did
not see the time-slice member in the thread TCB block. and the
"_time_slice_duration" object is global but not thread private, am i
right?

so the scheduler would be not thread evenly but force to schedule
without thought that whether it is the "current" thread cost up all
the time slice? because two thread with equal priority may release
cpu by volute yield operation, am i right?
That is correct: the time slicing is very coarse, and can be very unfair, depending when in the time slice the highest priority ready in the system changes. A thread can be preempted before it can execute a full time slice.

I personally don't like this policy. Changing it is one of the improvements that could be made to the kernel.

and ,by the way, did the zephyr has the plan to add the MMU support in
the future?
There have been some talks about this, and is something that will probably happen at some point. No plans yet though.

Cheers,
Ben

--
Benjamin Walsh, SMTS
WR VxWorks Virtualization Profile
www.windriver.com
Zephyr kernel maintainer
www.zephyrproject.org

Join devel@lists.zephyrproject.org to automatically receive all group messages.