Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-level scheduling #16

Open
nuta opened this issue Jul 25, 2020 · 1 comment
Open

User-level scheduling #16

nuta opened this issue Jul 25, 2020 · 1 comment

Comments

@nuta
Copy link
Owner

nuta commented Jul 25, 2020

This is the last piece for the policy-free kernel: allow userspace programs to decide how tasks are scheduled. The following design is based on MINIX3.

  • Implement a multi-priority round-robin scheduling:
    • The task with the highest priority runs forever until it spends its quantum.
    • If there're multiple tasks with the same priority, the kernel runs each task in a preemptive context switching with the hard-coded time slice in a round-robin fashion.
    • If a task spends the allocated quantum, the kernel refills it with reset. If reset is -1, it sends an exception message to its pager task.
    • If CPU affinity is set for a task, only specified CPUs are allowed to run the task.
  • Add sched system call.
    • error_t sys_sched(task_t task, int priority, int quantum, int reset, unsigned affinity);
  • sys_spawn: Add TASK_SCHED flag not to start the new task until sys_sched is invoked.
    • If it's not given, the task will be started with the lowest priority and the default quantum.
@nuta
Copy link
Owner Author

nuta commented Jul 25, 2020

TODO

  • Take a look at priority inheritance in IPC fast path
  • Investigate user-level scheduling at seL4

@nuta nuta mentioned this issue Jul 26, 2020
4 tasks
nuta added a commit that referenced this issue Sep 10, 2020
Finally, Resea Kernel become *policy-free* kernel. Currently this feature
is not yet used in the userspace, but it'll be a good example for educational
purposes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant