sched-rr: A round-robin scheduler for normal thread#129
sched-rr: A round-robin scheduler for normal thread#129louisom wants to merge 1 commit intof9micro:masterfrom louisom:feature/l4_rr_scheduler
Conversation
This is a round-robin scheduler implement for normal thread (user-thread) create by pager or pthread lib, and using timeslice, we can prevent user-space thread starvation trigger by busy loop. This scheduler only schedling user thread create by ipc "thread start protocal". Default timeslice is 4096 ticks for now. Other trivial change: - Update defconfing for all board - Add sched-rr into Makefile - Add new config in kernel/Kconfig for setting thread timeslice
jserv
left a comment
There was a problem hiding this comment.
Make rr as pluggable policy and refactor.
| board/$(BOARD) \ | ||
| include \ | ||
| include/platform \ | ||
| include/sched-rr \ |
There was a problem hiding this comment.
Don't name it after sched-rr. Instead, use include/sched and manipulate each scheduling policy through dedicated file.
|
|
||
| dirs = \ | ||
| kernel/lib \ | ||
| kernel/sched-rr \ |
| #include <user-log.h> | ||
| #include <ktimer.h> | ||
| #include <interrupt.h> | ||
| #include <sched-rr/sched_rr.h> |
| #include <types.h> | ||
| #include <thread.h> | ||
| #include <ktimer.h> | ||
| #include <sched-rr/sched_rr.h> |
| #include <platform/armv7m.h> | ||
| #include <fpage_impl.h> | ||
| #include <init_hook.h> | ||
| #include <sched-rr/sched_rr.h> |
| if (thr == NULL) | ||
| return NULL; | ||
|
|
||
| if ((thr = rr_select()) != NULL) |
There was a problem hiding this comment.
Please make scheduling policy pluggable as Linux kernel does.
There was a problem hiding this comment.
Is like insmod/rmmod or config in make config?
Thanks.
Also, Linux kernel scheduler is pluggable!? Ain't they choose when config?
There was a problem hiding this comment.
OMg is pluggable....since 2004!
There was a problem hiding this comment.
I meant pluggable scheduler framework.
There was a problem hiding this comment.
If rr_select returns NULL, thrwill be modified as NULL and unexpected result
will happen in the following code.
| default 256 | ||
|
|
||
| config THREAD_TIME_SLICE | ||
| int "Maximum timeslice for threads" |
This is a round-robin scheduler implement for normal thread (user-thread)
create by pager or pthread lib, and using timeslice, we can prevent user-space
thread starvation trigger by busy loop.
This scheduler only schedling user thread create by ipc "thread start protocal".
Default timeslice is 4096 ticks for now.
Other trivial change: