Discussion:
Using interrupts to control scheduling decisions in base-hw
Adrian Hengelhaupt
2016-07-14 12:42:58 UTC
Permalink
Hello,

My task is to implement a preemptive scheduler for a zynq-board.
Therefore I've tried to figure out how the cpu_scheduler program in
repos/baseh-hw/run/cpu_scheduler.run works and whether it can be used as
a foundation for my task.
So, my question is: How can I utilize interrupts in order to make
subsequent scheduling decisions?

Thanks in advance!

Greetings
Adrian
Stefan Kalkowski
2016-07-26 11:19:09 UTC
Permalink
Hello Adrian,
Post by Adrian Hengelhaupt
Hello,
My task is to implement a preemptive scheduler for a zynq-board.
Therefore I've tried to figure out how the cpu_scheduler program in
repos/baseh-hw/run/cpu_scheduler.run works and whether it can be used as
a foundation for my task.
the cpu_scheduler target is not a "program" in the common sense. It is a
unit test for our kernel, which is executed instead of starting any
userland components (core, init) on top of the kernel. The test is
executed within the kernel context, and uses the internal kernel API to
stress the already existent scheduler implementation.
If you want to replace the existent scheduler, I think it is not the
right place to start here, because the test is inherently bound to the
current implementation.

Just out of curiosity, what kind of scheduler do you want to implement?
Maybe you can model the semantic you deserve with the existent scheduler?
Post by Adrian Hengelhaupt
So, my question is: How can I utilize interrupts in order to make
subsequent scheduling decisions?
Currently, out of simplicity the kernel always asks the scheduler for a
new decision whenever the kernel is entered. This will possibly change
in the near future, but it's current state. So, whenever the kernel
timer or any other device triggered an interrupt, some other hardware
exception occurred (page-fault), or a component issued a system call,
the scheduler will be called to decide which thread is scheduled next.
The scheduler also implicitly adjusts the kernel timer by returning
"head_quota()" that is the time the currently scheduled thread can run
until the timer should fire.

To change the current implementation, please have a look at the
interface here:

repos/base-hw/src/core/include/kernel/cpu_scheduler.h

and especially its implementation:

repos/base-hw/src/core/kernel/cpu_scheduler.cc

Regards
Stefan
Post by Adrian Hengelhaupt
Thanks in advance!
Greetings
Adrian
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
genode-main mailing list
https://lists.sourceforge.net/lists/listinfo/genode-main
--
Stefan Kalkowski
Genode Labs

https://github.com/skalk ยท http://genode.org/
Loading...