Top Banner
1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I
24

1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

Mar 26, 2015

Download

Documents

Avery Hagan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

1

Class-based prioritized resource control in Linux

Amit Khanna

Roll No 4134, BE - I

Page 2: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

2

Outline

Motivation Framework Classification Engine (CE) Resource Schedulers Resource Monitoring User Interface Conclusion and Future Work

Page 3: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

3

Introduction

Workload Any system work with a distinct business goal A set of kernel tasks executing over some

duration Vary in their importance Resource demands

Diverse Dynamically changing

Page 4: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

4

Workload Management

Current scenario Manual Static

Workload Managers (WLM) Differentiated service Translate business goals to system goals Ability to handle dynamically changing

resource requirements

Page 5: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

5

Class-based Kernel Resource Management (CKRM) Class - A dynamic grouping of OS objects

Entitlements Reclassification of a task Hierarchical

Classification Rule - Method by which a task can be classified into a class

Policy - A collection of class definitions and classification rules

Page 6: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

6

Components of CKRM

Core Defines the basic entities Link between all the other components

Classification Engine (CE) Classifies kernel objects into classes

Class-aware Resource Controllers RCFS (Resource Control File System)

User-Kernel interface for CKRM

Page 7: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

7

Components of CKRM

UserKernel

Resource Management Middleware

System Administrator

Classification Filesystem

RCFS (Resource Control Filesystem)

CKRM API

Externally defined Policy--Rules -- Class defs

Classification EngineCKRM Core

fork()exec()…

Share Usage(per- resource)

Class AT1

T2

T4

Share Usage(per- resource)

Class DT4

Reclassification

Class Aware Patches

Resource SchedulersCPU, Disk I/O, Network,

Memory

Class Aware Resource Allocation

Ti - Tasks- Patches

Resource request

Page 8: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

8

Classification Engine (CE)

Optional component (module) Automatically triggered on kernel events

Eg. setuid, fork, exec RBCE (Rule Based Classification Engine) Rule format

A set of attribute-value tuples (A, V) and a class C

Eg gid=10, uid = 7, target = /rcfs/task_class/Gold

Page 9: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

9

CPU Controller

Current scheduler - O(1) scheduler One runqueue per CPU Active array and expired array 140 nice levels

Extensions Runqueues for each class for each CPU Hierarchical scheduling scheme ecp(C) = R * Σ cycles(C)/share(C) + top_prio

Page 10: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

10

Test Results

Class shares

•Gold – 60%

•Silver – 30%

•Bronze – 9%

•Best Effort – 1%

Nice Values : -20, -10, 0, 10, 19

Page 11: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

11

Memory Controller

Current Scenario Memory zones Page descriptor lists – active, inactive and free Page reclamation

Extensions Classes have associated share of physical memory No of pages allocated to a class are monitored Class shares are enforced only when system memory

is low Modified page reclamation

Page 12: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

12

Memory Usage Test Results

Test conducted on a 2.4GHz Pentium 4 desktop running Redhat Linux 9 and the 2.5.69 Linux kernel running using a simple microbenchmark

Total physical memory = 352 MB

Class A’s access freq = 2 * Class B’s access freq

Class A’s consumption = Class B’s consumption = 200 MB

Class A’s share/Class B’s

share

Page 13: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

13

Resource Monitoring

State-agent Runs in user-space Maintains state of existing and exited processes

Monitoring infrastructure design principles Event-driven

Aperiodic Periodic

Communication channel Minimal kernel state

Page 14: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

14

Resource Monitoring (continued)

Sampling Self-restarting kernel timer Struct delay_info Schedulers records timestamps Kernel module sends data to state-agent as

records

Page 15: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

15

Resource Control File System (RCFS)

/rcfs

/rcfs/task_class/rcfs/

socket_class /rcfs/ce

Files

member

config

target

shares

stats

Files

reclassify

state

Rules

Gold Music

Compile

Page 16: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

16

Conclusions and Future Work

Goal-oriented WLMs can automate low-level administration

Critical workloads can be protected from workload pressure by specifying their minimum shares

Redeveloping resource controllers to support hierarchy of classes

Cooperative communication between various resource controllers

Page 17: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

17

References

CKRM Open Source Project. Class-based kernel resource management. http://ckrm.sf.net/

Enabling Autonomic Workload Management in Linux, IEEE Proceedings, International Conference on Autonomic Computing (ICAC'04), 17-18 May 2004, Pages: 314 – 315

AIX 5L Workload Manager, IBM Corp.http://www.redbooks.ibm.com/redbooks/pdfs/sg245977.pdf

Page 18: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

18

Page 19: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

19

Scheduling Overhead

Test results have been measured using LMBench benchmark

Page 20: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

20

Figure 10: Monitoring and Control Approach

Page 21: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

21

for (i=0; i<50; i++)

{ start = get_time();

busy_waiting(N);

end = get_time();

response = end - start - N;

sleep(200) ;

}

Interactivity Test Code

Page 22: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

22

Interactivity Test Results

Gold, Bronze and Best Effort classes have 5 CPU bound jobs.

Silver class has an interactive job

Page 23: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

23

I/O Controller

Current scenario Each block device has a single logical queue Merges and sorts I/O requests made by block

layer Passes on the request to device driver

Extensions One queue per-class Moves the requests from input queue to

dispatch queue in proportion of their weight

Page 24: 1 Class-based prioritized resource control in Linux Amit Khanna Roll No 4134, BE - I.

24

I/O Controller

CKRM I/O Scheduler

Block Layer (Producer)

Low Level Device Driver (Consumer)

Output Queue

FCFS

Dequeue Function

Sort/ Merge

Enqueue Function

Per-class queues