Mutable Protection Domains: Towards a Component-based System for - - PowerPoint PPT Presentation

mutable protection domains towards a component based
SMART_READER_LITE
LIVE PREVIEW

Mutable Protection Domains: Towards a Component-based System for - - PowerPoint PPT Presentation

Mutable Protection Domains: Towards a Component-based System for Dependable and Predictable Computing Gabriel Parmer and Richard West Computer Science Deparment Boston University Boston, MA 02215 { gabep1, richwest } @cs.bu.edu December 6,


slide-1
SLIDE 1

Mutable Protection Domains: Towards a Component-based System for Dependable and Predictable Computing

Gabriel Parmer and Richard West

Computer Science Deparment Boston University Boston, MA 02215 {gabep1, richwest}@cs.bu.edu

December 6, 2007

slide-2
SLIDE 2

Complexity of Embedded Systems

Traditionally simpler software stack limited functionality and complexity focused application domain Soon cellphones will have 10s of millions of lines of code downloadable content (with real-time constraints) Trend towards increasing complexity of embedded systems

Parmer, West, BU CS Mutable Protection Domains 2/27

slide-3
SLIDE 3

Consequences of Complexity

Run-time interactions are difficult to predict and can cause faults accessing/modifying memory regions unintentionally corruption data-structures deadlocks/livelocks race-conditions . . . Faults can cause violations in correctness and predictability

Parmer, West, BU CS Mutable Protection Domains 3/27

slide-4
SLIDE 4

Designing for Dependability and Predictability

Given increasing complexity, system design must anticipate faults Memory fault isolation: limit scope of adverse side-effects of errant software identify and restart smallest possible section of the system recover from faults with minimal impact on system goals employ software/hardware techniques Preserve system reliability and predictability in spite of misbehaving and/or faulty software

Parmer, West, BU CS Mutable Protection Domains 4/27

slide-5
SLIDE 5

Trade-offs in Isolation Granularity

Increased Isolation Reduced Communication Cost

Protection Domains Components Threads Stacks

Process Isolation User-Kernel Isolation Library Isolation

Parmer, West, BU CS Mutable Protection Domains 5/27

slide-6
SLIDE 6

Static HW Fault Isolation Approaches

What is the “best” isolation granularity? P1 P2

user−level kernel−level

Net FS Monolithic OSs provide minimal isolation to allow process independence large kernel not self-isolated, possibly extend-able → Coarse-grained isolation, but low service invocation cost

Parmer, West, BU CS Mutable Protection Domains 6/27

slide-7
SLIDE 7

Static HW Fault Isolation Approaches (II)

What is the “best” isolation granularity?

P1 P2

user−level kernel−level IPC

Net FS

µ-kernels segregate system services out of the kernel, interact w/ Inter-Process Communication (IPC) finer-grained isolation

IPC overhead limits isolation granularity

→ Finer-grained fault isolation, but increased service invocation cost

Parmer, West, BU CS Mutable Protection Domains 6/27

slide-8
SLIDE 8

Static HW Fault Isolation Approaches (II)

What is the “best” isolation granularity?

P1 P2

user−level kernel−level IPC

Net FS

µ-kernels segregate system services out of the kernel, interact w/ Inter-Process Communication (IPC) finer-grained isolation

IPC overhead limits isolation granularity

→ Finer-grained fault isolation, but increased service invocation cost Both characterized by a static system structure

Parmer, West, BU CS Mutable Protection Domains 6/27

slide-9
SLIDE 9

Mutable Protection Domains (MPD)

Goal: configure system to have finest grained fault isolation while still meeting application deadlines Mutable Protection Domains (MPDs) dynamically place protection domains between components in response to

communication overheads due to isolation application deadlines being satisfied

application close to missing deadlines → lessen isolation between components laxity in application deadlines → increase isolation between components

Parmer, West, BU CS Mutable Protection Domains 7/27

slide-10
SLIDE 10

Mutable Protection Domains (MPD) (II)

Mutable Protection Domains appropriate for soft real-time systems Protection domains can be made immutable where appropriate

Parmer, West, BU CS Mutable Protection Domains 8/27

slide-11
SLIDE 11

Setup and Assumptions

TCP UDP

  • P. Filter

IP Socket

System is a collection of components Arranged into a directed acyclic graph (DAG) nodes = components themselves edges = communication between them, indicative of control flow Isolation over an edge can be configured to be one of the three isolation levels

Protection Domains Components Threads Stacks

Parmer, West, BU CS Mutable Protection Domains 9/27

slide-12
SLIDE 12

Isolation cost and benefit

Isolation between components causes a performance penalty due to:

1 processing cost of a single invocation between those

components

2 the frequency of invocations between those components

→ cost of each isolation level/edge Different isolation levels yield higher dependability stronger isolation → higher dependability Isolation between specific components more important debugging, testing, unreliable components, . . . → benefit of each isolation levels/edge

Parmer, West, BU CS Mutable Protection Domains 10/27

slide-13
SLIDE 13

Isolation cost and benefit

Isolation between components causes a performance penalty due to:

1 processing cost of a single invocation between those

components

2 the frequency of invocations between those components

→ cost of each isolation level/edge Different isolation levels yield higher dependability stronger isolation → higher dependability Isolation between specific components more important debugging, testing, unreliable components, . . . → benefit of each isolation levels/edge This paper studies the policies concerning when and where isolation should be present

Parmer, West, BU CS Mutable Protection Domains 10/27

slide-14
SLIDE 14

Problem Definition

For a solution set s where si ∈ {1, . . . , # isolation levels}

Parmer, West, BU CS Mutable Protection Domains 11/27

slide-15
SLIDE 15

Problem Definition

For a solution set s where si ∈ {1, . . . , # isolation levels} Maximize the dependability of the system . . . maximize

  • ∀i∈edges benefitisi

Parmer, West, BU CS Mutable Protection Domains 11/27

slide-16
SLIDE 16

Problem Definition

For a solution set s where si ∈ {1, . . . , # isolation levels} Maximize the dependability of the system . . . maximize

  • ∀i∈edges benefitisi

While meeting task deadlines . . . while

  • ∀i∈edges costisi

≤ surplus resources

Parmer, West, BU CS Mutable Protection Domains 11/27

slide-17
SLIDE 17

Problem Definition

For a solution set s where si ∈ {1, . . . , # isolation levels} Maximize the dependability of the system . . . maximize

  • ∀i∈edges benefitisi

While meeting task deadlines . . . while

  • ∀i∈edges costisik ≤

surplus resourcesk For each task in the system ∀k ∈ tasks

Parmer, West, BU CS Mutable Protection Domains 11/27

slide-18
SLIDE 18

Multi-Dimensional, Multiple-Choice Knapsack

maximize

  • ∀i∈edges

benefitisi subject to

  • ∀i∈edges

costisik ≤ surplus resourcesk, ∀k ∈ tasks si ∈ {1, . . . , max isolation level}, ∀i ∈ edges This problem is a multi-dimensional, multiple-choice knapsack problem (MMKP) multi-dimensional - multiple resource constraints multiple-choice - configure each edge in one of the isolation levels NP-Hard problem heuristics, pseudo-poly dynamic prog., branch-bound

Parmer, West, BU CS Mutable Protection Domains 12/27

slide-19
SLIDE 19

One-Dimensional Knapsack Problem

Effective and inexpensive greedy solutions to one-dimensional knapsack problem exist sort isolation levels/edges based on benefit density, ratio

  • f benefit to cost

increase isolation by including isolation levels/edges from head until resources are expended . . . but we have multiple dimensions of cost

Parmer, West, BU CS Mutable Protection Domains 13/27

slide-20
SLIDE 20

Solutions - Reducing Resource Dimensions

Compute an aggregate cost for each edge single value representing a combination of the costs for all tasks for an edge: ∀k, costisik → agg costisi some tasks very resource constrained, some aren’t intelligently weight costs for task k to compute aggregate cost

Parmer, West, BU CS Mutable Protection Domains 14/27

slide-21
SLIDE 21

Solutions - HEU

1 compute aggregate cost for each isolation level/edge 2 include isolation level/edge with best benefit density in

solution configuration

3 goto 1 until resources expended

Fine-grained refinement of aggregate cost recompute once every time an isolation level/edge is added to the current solution configuration

Parmer, West, BU CS Mutable Protection Domains 15/27

slide-22
SLIDE 22

Solutions - coarse and oneshot Refinement

1 compute aggregate cost for each isolation level/edge 2 sort by benefit density 3 include isolation level/edge from head 4 goto 3, until resources expended 5 recompute aggregate costs based on resource surpluses

with solution configuration

6 goto 2 N times and return highest benefit configuration

N > 1: coarse-grained refinement recompute once per total configuration found execution time linearly increases with N N = 1: oneshot very quick no aggregate cost refinement

Parmer, West, BU CS Mutable Protection Domains 16/27

slide-23
SLIDE 23

Solution Runtimes

1 10 100 1000 10000 100000 1000000 100 500 1500 3000

Number of Isolation Instances Runtime (microseconds)

  • neshot

coarse fine

Parmer, West, BU CS Mutable Protection Domains 17/27

slide-24
SLIDE 24

System Dynamics

System is dynamic changing communication costs over edges as threads alter execution paths between components changing resource availabilities as threads vary intra-component execution time per-invocation cost overheads vary

different cache working sets, invocation argument size, . . .

System must refine the system isolation configuration as these variables change

Parmer, West, BU CS Mutable Protection Domains 18/27

slide-25
SLIDE 25

Solutions over time

System dynamics require re-computation of system configuration

1 disregard current system state, recompute entirely new

system configuration

traditional knapsack (MMKP) approach: ks

2 solve for the next system configuration starting from the

current system configuration Successive State Heuristic (ssh)

modifies coarse and oneshot to start from the current system configuration aim to reduce isolation changes to existing configuration

Parmer, West, BU CS Mutable Protection Domains 19/27

slide-26
SLIDE 26

Experimental Simulations

Simulate a system with widely varying resource surplus for 3 tasks changing communication costs 200 edges, 3 isolation levels

Parmer, West, BU CS Mutable Protection Domains 20/27

slide-27
SLIDE 27

Resource Usage for Task 1

2000 4000 6000 8000 10000 5 10 15 20 25 30 35 40 45 50 55 Resources Used For Isolation (Task 1) Reconfiguration Number ks oneshot ks coarse ssh oneshot ssh coarse ks fine Resource Avail.

Parmer, West, BU CS Mutable Protection Domains 21/27

slide-28
SLIDE 28

System Isolation-Derived Benefit

10000 12000 14000 16000 18000 20000 22000 24000 5 10 15 20 25 30 35 40 45 50 55 Benefit Reconfiguration Number ks oneshot ks coarse ssh oneshot ssh coarse ks fine

Parmer, West, BU CS Mutable Protection Domains 22/27

slide-29
SLIDE 29

OS Support for MPD

Composite: component-based OS designed to support MPD

KCap UCap client stub

user−level kernel

client_fn server_fn stub server

Parmer, West, BU CS Mutable Protection Domains 23/27

slide-30
SLIDE 30

OS Support for MPD (II)

Composite: component-based OS designed to support MPD

KCap UCap server stub client stub

user−level kernel

server_fn client_fn

Parmer, West, BU CS Mutable Protection Domains 24/27

slide-31
SLIDE 31

OS Support for MPD (III)

Switching between the two isolation levels requires changing UCap, KCap, and protection domains Prototype running on x86 Pentium IV @ 2.4 Ghz Invocation via kernel - 1510 cycles (0.63 µsecs) Direct invocation - 55 cycles (0.023 µsecs)

Parmer, West, BU CS Mutable Protection Domains 25/27

slide-32
SLIDE 32

Conclusions

Solution to MMKP based on lightweight successive refinement given dynamic changes in system behavior possibly useful in e.g. QRAM Mutable Protection Domains dynamically reconfigure protection domains to maximize fault isolation while meeting application deadlines makes the performance/predictability ↔ fault isolation tradeoff explicit

Parmer, West, BU CS Mutable Protection Domains 26/27

slide-33
SLIDE 33