2009年8月31日 星期一

fiasco的scheduler

這一篇主要是參考fiasco官方網站上面的文件所寫的
但是fiasco的官方網站上面只有說明他scheduler的概念並沒有說明對應的檔案是在哪裡

根據官方的文件 fiasco的scheduler是preemptive prioriy-based的scheduler
他總共有256的priority level 數字越高代表 priority越高
當有兩個priority一樣的時候  這個時候就是用round-robin來決定各自要run多久
在fiasco中有一個256個element的array 每一個entry代表一個priority
每個entry裡面都有doubly-linked circular list 串成一環ready threads
fiasco另外為了加速還會存有一個變數是現在最高的priority

大概是這個樣子  主要有關的檔案是
(fiasco top)/fiasco/src/kern/Context.cpp   -> execution context
(fiasco top)/fiasco/src/kern/sched_context.cpp -> scheduling context
這兩個檔案分別對應到官方文件上的兩個context
跟scheduling有關的內容是存在 scheduling context
也就是說像priority跟time quantum等等的資訊是存在這裡

看了一下要怎麼修改這些scheduling的參數
fiasco提供system call的方式來 給定新的參數
l4_thread_schedule就有提供這些修改的參數

=====================================
另外我無聊在看一些data type就看到Cpu_time 這個data type
這個data type的真實type是Unsigned64 就是64bit的unsigned int
這個的重點是說這個data type在不同的arch底下會定義在不同的file中
像arm的話是定義在(fiasco top)/src/types/arm/types-arch.h中
還有就是這個data type的目的是要當作clock來用

沒有留言:

張貼留言