Commit 6c3a5dd
committed
Refactor priority-change path and introduce sched_migrate_task()
This commit introduces the sched_migrate_task() helper, which handles
migration of a task to the correct ready queue when its priority changes.
If the task is already in a ready queue, the helper dequeues it from the
old priority level, enqueues it into the new one, and updates all related
bookkeeping.
In addition, if a TASK_RUNNING task changes its priority, it now yields
immediately. This ensures that the scheduler always executes tasks in
strict priority order, preventing a running task from continuing to run
at an outdated priority level.1 parent 2148812 commit 6c3a5dd
1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
860 | 866 | | |
861 | 867 | | |
862 | 868 | | |
863 | 869 | | |
864 | 870 | | |
865 | 871 | | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
866 | 876 | | |
867 | 877 | | |
868 | 878 | | |
| |||
0 commit comments