Add strictly limit check: The current sporadic scheduler cannot handler duties > 50%

This commit is contained in:
Gregory Nutt 2015-07-30 07:36:01 -06:00
parent fb82061bf7
commit 3a93be8902
2 changed files with 14 additions and 0 deletions

View File

@ -163,8 +163,15 @@ int sched_setparam(pid_t pid, FAR const struct sched_param *param)
/* The replenishment period must be greater than or equal to the
* budget period.
*/
#if 1
/* REVISIT: In the current implementation, the budget cannot exceed
* half the duty.
*/
if (repl_ticks < (2 * budget_ticks))
#else
if (repl_ticks < budget_ticks)
#endif
{
errcode = EINVAL;
goto errout_with_lock;

View File

@ -209,8 +209,15 @@ int sched_setscheduler(pid_t pid, int policy,
/* The replenishment period must be greater than or equal to the
* budget period.
*/
#if 1
/* REVISIT: In the current implementation, the budget cannot
* exceed half the duty.
*/
if (repl_ticks < (2 * budget_ticks))
#else
if (repl_ticks < budget_ticks)
#endif
{
errcode = EINVAL;
goto errout_with_irq;