[xv6-kernel] Priority scheduling

Kieun Kim·2021년 7월 21일
0

xv6-kernel

목록 보기
3/4

1. Lab2 ; implement priority scheduling

  • Edit system call 'getpriority' and 'setpriority'
  • Edit the range of priority for each process from [0, 31] to [-10, 10]
  • In fork for process, priority of a process is set to 0
  • Make test case for priority scheduling
    • I received several cases for checking execution of scheduler in priority scheduling from peers
  • Impelment a scheduler function in priority scheduling
    1) Determine a max value of priority for a runnable process in process table
    2) Using cursor, find a process which has the determined max value and is runnable for context switch
    3) When a process is founded, context switch occurs
  • The test case is a tool for examining a performance of function, and through this, I checked the missed case and redeemed function.

2. Lab 2 ; Wrap up for solving lab2's assignment

1) Implement aging priority for avoiding starvation

  • When the process run, decrease priority according to specific metric
  • Specific metric
    • If we use ticks, can we figure out the process's execution time ?
      • The timer interrupt in xv6

      • The timer device : It generate them at any time

      • The timer interrupts
        a. The timer hardware makes interrupt 100 times per second

        b. The kernel can track the passage of time and time-slice among multiple running process

        c. Trap when it's called for a time interrupt,

        • increment ticks variable
        • call wakeup function

2) Implement priority donation / priority inheritance

  • Representive case
    • A parent process's priority is 5, but his child process's priority is 1. This parent process should wait the child process. If there is another process which has priority 3, how the priority scheduling works?

3) Add fields for tracking the scheduling performance and it allows to compute wait time and turnaround time
4) Add system call to extract the field in 3) or alternatively print them when the process exits

profile
Connecting dots

0개의 댓글