-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Background
The rtsched.c application demonstrates Linmo's real-time scheduler feature with a credit-based scheduling algorithm. The test spawns 5 tasks:
- Task 1, 2, 3: Configured as real-time tasks with credit-based priorities (3, 4, 5 credits respectively)
- Task 4, 5: Standard non-RT tasks using default round-robin scheduling
Observed Behavior
When running the application on QEMU with preemptive scheduling enabled, the output shows:
[Task 1: 100000]
[Task 1: 100001]
[Task 1: 100002]
[Task 3: 300000]
[Task 3: 300001]
...
Task 3 running
Task 3 running
Task 4 running
Task 4 running
...
Problems identified:
- Task 1 executes only 3 times, then stops appearing in the output
- Task 2 never executes at all - no output from Task 2
- Task 5 never executes - no output from Task 5
- Task 3 and Task 4 monopolize the CPU
Expected Behavior
Based on the credit-based scheduler design:
- Real-time tasks (1, 2, 3) should execute according to their credit allocation:
- Task 1: 3 credits per cycle
- Task 2: 4 credits per cycle
- Task 3: 5 credits per cycle
- Non-RT tasks (4, 5) should get CPU time when no RT tasks are ready
- All tasks should have fair access to the CPU over time
- Output should show interleaved execution of all 5 tasks with RT tasks getting proportional CPU time
Root Cause Analysis
RT tasks are not being selected by the scheduler. The custom_sched() function appears to fail returning valid RT task IDs, causing only non-RT tasks (4, 5) to be scheduled by the fallback mechanism.
Steps to Reproduce
-
Build and run the
rtschedapplication on QEMUmake rtsched make run
-
Observe the output
-
Notice that Task 1, 2, 3 do not appear or appear only briefly
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working