Discussion:
Compilation error in sporadic_set_hipriority() function.
(too old to reply)
eunb.song@samsung.com [nuttx]
2018-01-18 04:08:52 UTC
Permalink
Please, fix this compilation error.


static int sporadic_set_hipriority(FAR struct tcb_s *tcb)
{
FAR struct sporadic_s *sporadic;
int ret;


DEBUGASSERT(tcb != NULL && tcb->sporadic != NULL);
sporadic = tcb->sporadic;


#ifdef CONFIG_SPORADIC_INSTRUMENTATION
/* Inform the monitor of this event */


arch_sporadic_start(tcb);
#endif


#ifdef CONFIG_PRIORITY_INHERITANCE
/* If the priority was boosted above the higher priority, than just
* reset the base priority.
*/


if (tcb->sched_priority > tcb->base_priority)
{
/* Boosted... Do we still need to reprioritize? */


if (sporadic->hi_priority < sporadic->base_priority)
--> sporadic_s structure does not have base_priority field. this causes compilation error when priority inheritance is enabled.
{
/* No.. the current execution priority is lower than the
* boosted priority. Just reset the base priority.
*/


tcb->base_priority = sporadic->hi_priority;
return OK;
}
}
spudarnia@yahoo.com [nuttx]
2018-01-19 01:04:50 UTC
Permalink
I have been planning to re-implement sporadic scheduling for some time. I believe that the current implementation is unnecessarily complex. There is no clear statement for the requirements of sporadic scheduling that I could find, so I based the design on some behaviors of another OS that I saw published (QNX as I recall).


But I think that the bottom line requirement for sporadic scheduling is that is it should make a best attempt to control a fixed percentage of CPU bandwidth for a task in during an interval only by modifying it is priority between a low and a high priority. The current design involves timers and a lot of nonsense to duplicate QNX behavior that I think I not necessary.


So I will not be addressing this in the near future.. not until I am motivated to do that redesign. Then I will certainly take priority inheritance into account.


For TinyAra in TizenRT, my recommendation is that you simply remove support for sporadic scheduling. You probably do not need it and it is unlikely that my re-implementation, whenever I am motivated to do it, will be compatible with the ancient version of NuttX that you based TinyAra on.


Greg
eunb.song@samsung.com [nuttx]
2018-01-22 04:23:22 UTC
Permalink
Hi, Greg.

Thanks for your kind and detailed explanation about sporadic scheduler in Nuttx.
You're great!!.
OK, i will follow your recommendation.


Thanks again.
spudarnia@yahoo.com [nuttx]
2018-01-22 13:22:33 UTC
Permalink
I did fix the compilation errors that you mentioned, but there are other issues I found in reviewing code when priority inheritance is used with the sporadic scheduler. See the TODO list: https://bitbucket.org/nuttx/nuttx/src/6ae6ecc958d207fcab26e0811bfa07a1744ca9ac/TODO?at=master&fileviewer=file-view-default#TODO-330 https://bitbucket.org/nuttx/nuttx/src/6ae6ecc958d207fcab26e0811bfa07a1744ca9ac/TODO?at=master&fileviewer=file-view-default#TODO-330
Loading...