Knit: Component Composition for Systems Software Alastair Reid, - - PowerPoint PPT Presentation

knit component composition for systems software
SMART_READER_LITE
LIVE PREVIEW

Knit: Component Composition for Systems Software Alastair Reid, - - PowerPoint PPT Presentation

Knit: Component Composition for Systems Software Alastair Reid, Matthew Flatt, Leigh Stoller, Jay Lepreau, Eric Eide University of Utah Knit 1 Why Components? Everyone is writing too much code Not enough code reuse Hard to


slide-1
SLIDE 1

Knit 1

Knit: Component Composition for Systems Software

Alastair Reid, Matthew Flatt, Leigh Stoller, Jay Lepreau, Eric Eide University of Utah

slide-2
SLIDE 2

Knit 2

Why Components?

Everyone is writing too much code

Not enough code reuse Hard to reconfigure Hard to understand Hard to test/verify

Exceptions: Click, Scout, Ensemble, Fox,

MMLite, OSKit, …

slide-3
SLIDE 3

Knit 3

Why Not Components?

Overhead

Runtime Programmer time

Advanced systems don’t work with C Complex component interdependencies

Locking restrictions Top/bottom-half Bootstrap sequence

slide-4
SLIDE 4

Knit 4

Goal of Knit Project

To make components practical for systems programming

slide-5
SLIDE 5

Knit 5

Key to Achieving Goal

Static configuration language

Enables error detection Enables optimization

slide-6
SLIDE 6

Knit 6

Target#1: The Utah OSKit [SOSP’97]

Approximately 500 components:

Device drivers, bootstrap code, TCP/IP stacks, filesystems, SNMP, etc.

Doesn’t impose architecture 106 lines of code from Linux, FreeBSD,

NetBSD, Mach, Fluke, etc.

slide-7
SLIDE 7

Knit 7

Outline

Introduction The Knit component model

Atomic units Compound units Automatic Initialization Detecting Configuration Errors

Implementation and Performance Open issues

slide-8
SLIDE 8

Knit 8

Atomic Units [PLDI’98]

s e r ve _c gi s e r ve _we b i nt s e r ve _we b( … ) { i f ( … ) s e r ve _c gi ( … ) ; e l s e s e r ve _f i l e ( … ) ; } s e r ve _f i l e

  • I os ki t
  • DKERNEL
  • DHAVE_CONFI G
slide-9
SLIDE 9

Knit 9

Compound Units [PLDI’98]

f i l e s s e r ve _we b pr oc e s s e s serve_file select_server serve_cgi

slide-10
SLIDE 10

Knit 10

Initialization

x86 main pthreads VM init_x86(); init_IDE(); init_VM(); init_threads(); init_filesys(); init_main(); filesys IDE

slide-11
SLIDE 11

Knit 11

Initialization

x86 main pthreads VM init_x86(); init_IDE(); init_VM(); init_threads(); init_filesys(); init_main(); filesys IDE X

slide-12
SLIDE 12

Knit 12

When Can We Break Cycles?

1.

Component ‘contains’ subcomponents

2.

No dependency between initializers VM threads locks f_init f g g_init

slide-13
SLIDE 13

Knit 13

Automatic Initialization

Knit generates initialization sequence Cycles are resolved by refining

initialization dependencies in units

Experience

5% of units need dependencies refined Programmers find initialization a big win

slide-14
SLIDE 14

Knit 14

Detecting Composition Errors

ethernet panic console filesys threads

slide-15
SLIDE 15

Knit 15

Detecting Composition Errors

ethernet panic console filesys threads interrupts locks

slide-16
SLIDE 16

Knit 16

Detecting Composition Errors

ethernet panic console filesys threads interrupts locks

slide-17
SLIDE 17

Knit 17

Detecting Composition Errors

ethernet panic console filesys threads interrupts locks

slide-18
SLIDE 18

Knit 18

Detecting Composition Errors

ethernet panic console filesys threads interrupts locks

slide-19
SLIDE 19

Knit 19

Detecting Composition Errors

ethernet panic console filesys threads interrupts locks

slide-20
SLIDE 20

Knit 20

Detecting Composition Errors

ethernet panic console filesys threads interrupts locks

slide-21
SLIDE 21

Knit 21

Detecting Composition Errors

ethernet panic console filesys threads

context(threads) <= ProcessContext context(filesys) <= context(threads) context(console) <= context(filesys) context(panic) <= context(console) NoContext <= context(ethernet) ProcessContext < NoContext

slide-22
SLIDE 22

Knit 22

Extensible Constraint System

Constraint system propagates properties

through component interconnections

Knit can detect global errors

Constraint system is extensible

In context X, don’t do Y Type system for Modular IP Routers

(e.g., Click)

slide-23
SLIDE 23

Knit 23

Knit

Supports C, assembly and object files Separates interconnections from code Automatic initialization Extensible constraint system Allows cyclic component dependencies Allows multiple instances of components Text based

slide-24
SLIDE 24

Knit 24

Outline

Introduction The Knit component model Implementation and Performance Open issues

slide-25
SLIDE 25

Knit 25

Implementation (Unoptimized)

ld a.out symbol_rename cc Knit .o .o .c .unit

slide-26
SLIDE 26

Knit 26

Performance

Component cost should not distort system structure Reduce overhead by eliminating function calls

slide-27
SLIDE 27

Knit 27

Click and Clack

Click modular network router from MIT

[SOSP’99]

Clack

Re-implementation of Click using Knit Similar performance to Click

Many small components

slide-28
SLIDE 28

Knit 28

Performance of Clack

100% 79% 65% 0% 25% 50% 75% 100% Unoptimized Monolithic Optimized

Time per Packet

slide-29
SLIDE 29

Knit 29

Open Issues

Is Knit general purpose?

Need more users Need more applications

Is the constraint system extensible enough? Implicit linking vs. explicit linking?

slide-30
SLIDE 30

Knit 30

Conclusions

State of the art component system for C Targeted at systems code

Automatic initialization Detects local and global errors Low performance overhead

Available ASAP: http://www.cs.utah.edu/flux/