Presentation is loading. Please wait.

Presentation is loading. Please wait.

Knit1 Knit: Component Composition for Systems Software Alastair Reid, Matthew Flatt, Leigh Stoller, Jay Lepreau, Eric Eide University of Utah.

Similar presentations


Presentation on theme: "Knit1 Knit: Component Composition for Systems Software Alastair Reid, Matthew Flatt, Leigh Stoller, Jay Lepreau, Eric Eide University of Utah."— Presentation transcript:

1 Knit1 Knit: Component Composition for Systems Software Alastair Reid, Matthew Flatt, Leigh Stoller, Jay Lepreau, Eric Eide University of Utah

2 Knit2 Why Components? Everyone is writing too much code 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, … Exceptions: Click, Scout, Ensemble, Fox, MMLite, OSKit, …

3 Knit3 Why Not Components? Overhead Overhead  Runtime  Programmer time Advanced systems don’t work with C Advanced systems don’t work with C Complex component interdependencies Complex component interdependencies  Locking restrictions  Top/bottom-half  Bootstrap sequence

4 Knit4 Goal of Knit Project To make components practical for systems programming

5 Knit5 Key to Achieving Goal Static configuration language  Enables error detection  Enables optimization

6 Knit6 Target#1: The Utah OSKit [SOSP’97] Approximately 500 components: Approximately 500 components: Device drivers, bootstrap code, TCP/IP stacks, filesystems, SNMP, etc. Device drivers, bootstrap code, TCP/IP stacks, filesystems, SNMP, etc. Doesn’t impose architecture Doesn’t impose architecture 10 6 lines of code from Linux, FreeBSD, NetBSD, Mach, Fluke, etc lines of code from Linux, FreeBSD, NetBSD, Mach, Fluke, etc.

7 Knit7 Outline Introduction Introduction The Knit component model The Knit component model  Atomic units  Compound units  Automatic Initialization  Detecting Configuration Errors Implementation and Performance Implementation and Performance Open issues Open issues

8 Knit8 Atomic Units [PLDI’98] serve_cgi serve_web int serve_web(…) { if (…) serve_cgi(…); else serve_file(…); } serve_file -Ioskit -DKERNEL -DHAVE_CONFIG

9 Knit9 Compound Units [PLDI’98] files serve_web processes serve_file select_server serve_cgi

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

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

12 Knit12 When Can We Break Cycles? 1. Component ‘contains’ subcomponents 2. No dependency between initializers VMthreadslocks f_initfgg_init

13 Knit13 Automatic Initialization Knit generates initialization sequence Knit generates initialization sequence Cycles are resolved by refining initialization dependencies in units Cycles are resolved by refining initialization dependencies in units Experience Experience  5% of units need dependencies refined  Programmers find initialization a big win

14 Knit14 Detecting Composition Errors ethernet panic console filesys threads

15 Knit15 Detecting Composition Errors ethernet panic console filesys threads interrupts locks

16 Knit16 Detecting Composition Errors ethernet panic console filesys threads interrupts locks

17 Knit17 Detecting Composition Errors ethernet panic console filesys threads interrupts locks

18 Knit18 Detecting Composition Errors ethernet panic console filesys threads interrupts locks

19 Knit19 Detecting Composition Errors ethernet panic console filesys threads interrupts locks

20 Knit20 Detecting Composition Errors ethernet panic console filesys threads interrupts locks

21 Knit21 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

22 Knit22 Extensible Constraint System Constraint system propagates properties through component interconnections Constraint system propagates properties through component interconnections  Knit can detect global errors Constraint system is extensible Constraint system is extensible  In context X, don’t do Y  Type system for Modular IP Routers (e.g., Click)  …

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

24 Knit24 Outline Introduction Introduction The Knit component model The Knit component model Implementation and Performance Implementation and Performance Open issues Open issues

25 Knit25 Implementation (Unoptimized) ld a.out symbol_rename cc Knit.o.c.unit

26 Knit26 Performance  Component cost should not distort system structure  Reduce overhead by eliminating function calls

27 Knit27 Click and Clack Click modular network router from MIT [SOSP’99] Click modular network router from MIT [SOSP’99] Clack Clack  Re-implementation of Click using Knit  Similar performance to Click Many small components Many small components

28 Knit28 Performance of Clack

29 Knit29 Open Issues Is Knit general purpose? Is Knit general purpose?  Need more users  Need more applications Is the constraint system extensible enough? Is the constraint system extensible enough? Implicit linking vs. explicit linking? Implicit linking vs. explicit linking?

30 Knit30 Conclusions State of the art component system for C State of the art component system for C Targeted at systems code Targeted at systems code  Automatic initialization  Detects local and global errors  Low performance overhead Available ASAP:


Download ppt "Knit1 Knit: Component Composition for Systems Software Alastair Reid, Matthew Flatt, Leigh Stoller, Jay Lepreau, Eric Eide University of Utah."

Similar presentations


Ads by Google