Linux Process (Task) Structure and Scheduling Overview - PowerPoint PPT Presentation

About This Presentation
Title:

Linux Process (Task) Structure and Scheduling Overview

Description:

Linux Process (Task) Structure and Scheduling Overview. CS3013 C02. Jae Chung ... Timer goes off (jiffy, 1 per 10 ms) then lose a count (0, then suspend) ... – PowerPoint PPT presentation

Number of Views:396
Avg rating:3.0/5.0
Slides: 7
Provided by: jaec
Learn more at: http://web.cs.wpi.edu
Category:

less

Transcript and Presenter's Notes

Title: Linux Process (Task) Structure and Scheduling Overview


1
Linux Process (Task) Structure and Scheduling
Overview
  • CS3013 C02
  • Jae Chung Hariharan Kannan

2
Process Control Block (PCB)
  • Process is called Task in Linux
  • PCB struct task_struct
  • Essentials pid, state, stack, files,
    semaphore
  • Task Ment next_task, prev_task, ptree,
  • Task Sched priority, counter, next_run,
    prev_run
  • Resource Usage times, maj_flt, min_flt, nswap
  • And more

3
Task Managements
Task Tree (All Tasks)
Task List (All Tasks)
Run Queue (Ready Tasks)
4
Linux Scheduler Functions
  • (Previous process give up CPU)
  • Handles interrupts (latter half)
  • Select next process (task) to run
  • Performs context switch if necessary
  • (Let go the next process selected)

5
Linux Process Scheduling
  • Normal Credit-Based (counter variable)
  • process with most credits is selected
  • goodness() 0 (if counter 0)
  • goodness() counter priority (otherwise)
  • Timer goes off (jiffy, 1 per 10 ms)
  • then lose a count (0, then suspend)
  • No runnable process (all suspended)
  • reload (recalculate) counter value
  • counter counter/2 priority
  • Real-Time goodness() 1000 rt_priority

6
Kernel Source Files to Start
  • /usr/src/linux/include/linux/sched.h
  • /usr/src/linux/kernel/sched.c
  • /usr/src/linux/kernel/sys.c (getrusage)
  • /usr/src/linux/kernel/fork.c (fork)
Write a Comment
User Comments (0)
About PowerShow.com