Skip to content

Conversation

@mlouielu
Copy link
Contributor

@mlouielu mlouielu commented Aug 24, 2017

This PR include three major fixed:

  1. Redesign RR scheduler to pass the test suite.
  2. Fix mutex, cond and pthread_mutex.
  3. Makefile can now switch scheduler via flags (make SCHED=RR)

@mlouielu mlouielu changed the title [WIP] Fix rr scheduler Fix RR scheduler and mutex/cond Aug 25, 2017
* 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.

## Makefile

You can switch scheduler by makefile flags:
Copy link
Member

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.

Copy link
Contributor Author

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.


int sched_select(int sched_type, struct thread_info *thread)
{
printk("Scheduler: ");
Copy link
Member

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.

Copy link
Contributor Author

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.

int sched_rr_init(void)
int sched_rr_init(struct thread_info *thread)
{
if (thread)
Copy link
Member

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.

Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants