Double scheduler queue to prevent CPU bound threads to lock the kernel #21

Open
opened 2023-01-05 19:26:41 +00:00 by juju · 0 comments
Owner

A malicious or CPU bound thread with never perform syscalls will always be rescheduled when preempted, thus will never allow the scheduler to asynchronously return and stoping the executor from running other tasks.

Add a second thread queue to the scheduler to hold already scheduled threads.

The scheduler will then schedule the threads by batch:
- Schedule a thread from the ready queue
- When preempted, push the threadId to the scheduled queue
- Continue until the ready queue is empty
- Once the ready queue is emptied the executor can schedule other async tasks
- On the next timer interrupt, refill the ready queue with the scheduled queue
- Scheduler can now run user threads again

A malicious or CPU bound thread with never perform syscalls will always be rescheduled when preempted, thus will never allow the scheduler to asynchronously return and stoping the executor from running other tasks. Add a second thread queue to the scheduler to hold already scheduled threads. The scheduler will then schedule the threads by batch: - Schedule a thread from the ready queue - When preempted, push the threadId to the scheduled queue - Continue until the ready queue is empty - Once the ready queue is emptied the executor can schedule other async tasks - On the next timer interrupt, refill the ready queue with the scheduled queue - Scheduler can now run user threads again
juju added the
Bug
Feature
Major
labels 2023-01-05 19:26:41 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: juju/JuliOS#21
No description provided.