EECS 750: Advanced Operating Systems 01/31 /2014 Heechul Yun - - PowerPoint PPT Presentation

eecs 750 advanced operating systems
SMART_READER_LITE
LIVE PREVIEW

EECS 750: Advanced Operating Systems 01/31 /2014 Heechul Yun - - PowerPoint PPT Presentation

EECS 750: Advanced Operating Systems 01/31 /2014 Heechul Yun Administrative Next summary assignment due by 11:59 p.m., Sunday Improving Performance Isolation on Chip Multiprocessors via an Operating System Scheduler, PACT07


slide-1
SLIDE 1

EECS 750: Advanced Operating Systems

01/31 /2014 Heechul Yun

slide-2
SLIDE 2

Administrative

  • Next summary assignment due

– by 11:59 p.m., Sunday – Improving Performance Isolation on Chip Multiprocessors via an Operating System Scheduler, PACT’07

  • Sign up for presentations

– First student presentation starts on Feb 3. (Monday)

  • Project group

– Due on Feb 3. (Monday)

slide-3
SLIDE 3

Recap: CPU Scheduling

  • Unicore scheduling

– Fairness and responsiveness – Completely Fair Scheduler – BVT

  • Multicore scheduling

– Partitioned scheduling – Load balancing – DWRR and global fairness

slide-4
SLIDE 4

Today

  • Topic: Group scheduling and resource management
  • Linux’s CGROUP mechanism
  • Resource Containers: A New Facility for Resource

Management in Server Systems, OSDI’99

slide-5
SLIDE 5

Process Abstraction

  • Basic unit for resource accounting

– E.g., cpu time spent, memory size, …

  • Basic unit for scheduling
  • But…
slide-6
SLIDE 6

A Scenario

  • Background tasks in your desktop

– E.g., BitTorrent, AntiVirus scan, create search indexes for local files, …

  • Control all background tasks to consume

– Less than 10% of CPU time – Less than 20% of total memory – Less than 50% of network bandwidth – …

slide-7
SLIDE 7

Another Scenario

  • Tasks in a server node

– Map/reduce processes – Web server processes – Search query processing processes – …

  • You want to

– Control all map/reduce processes’ resources – Control all web server processes’ resources – …

  • How?

(*) Figure source: Zheng et al, “CPI2: CPU performance isolation for shared compute clusters”, EuroSys’13

Threads/server at Google(*)

slide-8
SLIDE 8

CGROUP in Linux

  • Control Group

– Started by engineers at Google in 2006

  • Group multiple processes

– E.g., EECS750 (15 processes), EECS678 (30 processes) groups

  • Control resource usage on a per-group basis

– E.g., 70% CPU to EECS750, 30% CPU to EECS678

slide-9
SLIDE 9

Group Hierarchy

  • Represents a tree structured relationship

among groups

Root Group Undergraduate Group Graduate Group PhD Group Master Group

slide-10
SLIDE 10

Resource Management

  • Control resource allocation on a per-group basis

Root Group Undergraduate Group Graduate Group PhD Group Master Group 100% CPU 100% MEM 30% CPU 50% MEM 70% CPU 50% MEM 30% CPU 30% MEM 40% CPU 20% MEM

slide-11
SLIDE 11

CGROUP Subsystems

  • Control resources of a CGROUP
  • Available subsystems

– cpu CPU b/w limit, weight (share), … – memory memory size limit, … – cpuset cores, memory controllers, … – …

slide-12
SLIDE 12

Example

# mount -t cgroup none /sys/fs/cgroup; # cd /sys/fs/cgroup # mkdir grad; mkdir grad/phd; mkdir /grad/master → create ‘grad’, ‘phd’, ‘master’ CGROUPs # # echo 100 101 > grad/phd/tasks → assign PID 100, 101 to the ‘phd’ group # echo 200 201 202> grad/master/tasks → assign PID 200, 201,202 to the ‘master’ group # echo 3072 > grad/phd/cpu.shares # echo 4096 > grad/master/cpu.shares → assign 3:4 CPU weights to ‘phd’ and ‘master’ groups

See https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt

slide-13
SLIDE 13

Today’s Paper

  • Resource Containers: A New Facility for

Resource Management in Server Systems, OSDI’99

slide-14
SLIDE 14

Some Background

  • Dot-com bubble (1997-2000)

– Many internet companies were founded

  • Google: 1998, Netflix: 1997

– Every company wanted to create its website

  • Web server research

– First version of Apache webserver in 1995 – High performance web server was a hot topic

  • Client computing → Server computing
slide-15
SLIDE 15

Classical Application

  • An application = A process = A resource

principal (CPU time, memory)

slide-16
SLIDE 16

Kernel Intensive Application

  • Scenario: interrupt handling to receive packets for process A
  • ccurred while executing process B

– Time spent on ISR will be charged to process B’s system time. – Packet buffer memory is not charged to any process

  • Resources spent on kernel are not controlled
slide-17
SLIDE 17

Application with Multiple Processes

  • How to account and manage resources for a

group of processes?

slide-18
SLIDE 18

Resource Container

  • A logical abstraction to manage resources

– Resources: CPU time, memory, …

  • A resource container can be associated with

multiple processes (threads)

  • Can construct a hierarchy
slide-19
SLIDE 19

Example

Web Server

CGI Process #1 Static documents

Container 1

Dynamic document

Container 2

CGI Process #N

Web Clients

slide-20
SLIDE 20

Web Server Throughput

slide-21
SLIDE 21

Summary

  • Group resource management

– Generic abstraction to account and control resources

  • CGROUP in Linux

– Powerful tools which are heavily used by google cloud, android, and many Linux distros

slide-22
SLIDE 22

Discussion

  • What resources are important?
  • What resources are controllable by the OS?
  • What resources are not controllable by the

OS?