-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fix RR scheduler and mutex/cond #36
base: master
Are you sure you want to change the base?
Conversation
d7a5825
to
aa03033
Compare
2681d13
to
a01c51e
Compare
* mutex and cond should call `sched_dequeue` to remove `cur->ti_q` from its list when want to add `cur->ti_q` to another list. * Change itt (thumb instruction) to normal instruction, due to the problem on QEMU.
bf2a605
to
430a3bd
Compare
|
||
## Makefile | ||
|
||
You can switch scheduler by makefile flags: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make scheduler pluggable as Linux does instead of configuring it at build time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to change scheduler in runtime using sched_select
for now. But this is an easy step for running test and debugging.
430a3bd
to
7e298bf
Compare
7e298bf
to
f5d69e6
Compare
kernel/sched.c
Outdated
@@ -8,14 +8,18 @@ static const struct sched *sched; | |||
|
|||
int sched_select(int sched_type, struct thread_info *thread) | |||
{ | |||
printk("Scheduler: "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the invocation of printk
in order to display scheduler internals literally. Instead, we can always deploy custom GDB script to perform deeper and effective tracing over existing framework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll take a reference from f9-kernel, except gdb script, maybe some probe can be plugin.
{ | ||
if (thread) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we initialize without checking thread
? That is, we can explicitly arrange the order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not check about thread
is NULL or not (or maybe checking the type is struct thread_info
), is there any benefit to put a NULL into runqueue?
5e65244
to
04a4478
Compare
This PR include three major fixed:
make SCHED=RR
)