mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 16:59:28 +08:00
Add strictly limit check: The current sporadic scheduler cannot handler duties > 50%
This commit is contained in:
@@ -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
|
/* The replenishment period must be greater than or equal to the
|
||||||
* budget period.
|
* 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)
|
if (repl_ticks < budget_ticks)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
errcode = EINVAL;
|
errcode = EINVAL;
|
||||||
goto errout_with_lock;
|
goto errout_with_lock;
|
||||||
|
|||||||
@@ -209,8 +209,15 @@ int sched_setscheduler(pid_t pid, int policy,
|
|||||||
/* The replenishment period must be greater than or equal to the
|
/* The replenishment period must be greater than or equal to the
|
||||||
* budget period.
|
* 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)
|
if (repl_ticks < budget_ticks)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
errcode = EINVAL;
|
errcode = EINVAL;
|
||||||
goto errout_with_irq;
|
goto errout_with_irq;
|
||||||
|
|||||||
Reference in New Issue
Block a user