the scalable commutativity rule designing scalable
play

The Scalable Commutativity Rule: Designing Scalable Software for - PowerPoint PPT Presentation

The Scalable Commutativity Rule: Designing Scalable Software for Multicore Processors Austin T. Clements M. Frans Kaashoek Nickolai Zeldovich Robert Morris Eddie Kohler MIT CSAIL and Harvard Current approach to scalable software


  1. The Scalable Commutativity Rule: Designing Scalable Software for Multicore Processors Austin T. Clements M. Frans Kaashoek Nickolai Zeldovich Robert Morris Eddie Kohler † MIT CSAIL and † Harvard

  2. Current approach to scalable software development 2008 Corey 2009 OSDI '08 2010 Linux scalability OSDI '10 2011 Bonsai VM 2012 ASPLOS '12 2013 RadixVM EuroSys '13 2014

  3. Current approach to scalable software development 2008 Corey 2009 OSDI '08 2010 Linux scalability OSDI '10 Workload 2011 Bonsai VM 2012 ASPLOS '12 2013 RadixVM EuroSys '13 2014

  4. Current approach to scalable software development 2008 Corey 2009 OSDI '08 2010 Linux scalability OSDI '10 Plot Workload 2011 scalability Bonsai VM 2012 ASPLOS '12 2013 RadixVM EuroSys '13 2014

  5. Current approach to scalable software development 2008 Corey 2009 OSDI '08 Differential x() profile 2010 Linux scalability OSDI '10 Plot Workload 2011 scalability Bonsai VM 2012 ASPLOS '12 2013 RadixVM EuroSys '13 2014

  6. Current approach to scalable software development 2008 Corey 2009 OSDI '08 Differential x() profile 2010 Linux scalability OSDI '10 Plot Workload 2011 scalability Bonsai VM 2012 ASPLOS '12 Fix top +++ bottleneck 2013 RadixVM EuroSys '13 2014

  7. Current approach to scalable software development 2008 Corey 2009 OSDI '08 Differential x() profile 2010 Linux scalability OSDI '10 Plot Workload 2011 scalability Bonsai VM 2012 ASPLOS '12 Fix top +++ bottleneck 2013 RadixVM EuroSys '13 2014

  8. Current approach to scalable software development Successful in practice because it focuses developer effort Disadvantages • New workloads expose new bottlenecks • More cores expose new bottlenecks • The real bottlenecks may be in the interface design

  9. Current approach to scalable software development Successful in practice because it focuses developer effort Disadvantages • New workloads expose new bottlenecks • More cores expose new bottlenecks • The real bottlenecks may be in the interface design

  10. Interface scalability example creat("x") creat("y") creat("z")

  11. Interface scalability example creat("x") creat("y") creat("z") stdin stdout stderr

  12. Interface scalability example creat("x") creat("y") creat("z") stdin stdout stderr

  13. Approach: Interface-driven scalability The scalable commutativity rule Whenever interface operations commute, they can be implemented in a way that scales.

  14. Approach: Interface-driven scalability The scalable commutativity rule Whenever interface operations commute, they can be implemented in a way that scales. Scalable implementation Commutes exists ? creat with lowest FD

  15. Approach: Interface-driven scalability The scalable commutativity rule Whenever interface operations commute, they can be implemented in a way that scales. Scalable implementation Commutes exists ? creat with lowest FD creat → 3 creat → 4

  16. Approach: Interface-driven scalability The scalable commutativity rule Whenever interface operations commute, they can be implemented in a way that scales. Scalable implementation Commutes exists creat with lowest FD ✗

  17. Approach: Interface-driven scalability The scalable commutativity rule Whenever interface operations commute, they can be implemented in a way that scales. Scalable implementation Commutes exists creat with lowest FD ✗ ? creat with any FD creat → 42 creat → 17

  18. Approach: Interface-driven scalability The scalable commutativity rule Whenever interface operations commute, they can be implemented in a way that scales. Scalable implementation Commutes exists creat with lowest FD ✗ rule creat with any FD ✓ ✓

  19. Advantages of interface-driven scalability The rule enables reasoning about scalability throughout the software design process Design Guides design of scalable interfaces Implement Sets a clear implementation target Test Systematic, workload-independent scalability testing

  20. Contributions The scalable commutativity rule • Formalization of the rule and proof of its correctness • State-dependent, interface-based commutativity Commuter: An automated scalability testing tool sv6: A scalable POSIX-like kernel

  21. Outline Defining the rule • Definition of scalability • Intuition • Formalization Applying the rule • Commuter • Evaluation

  22. A scalability bottleneck 40 gmake Exim 35 Normalized throughput 30 25 20 15 10 5 0 1 6 12 18 24 30 36 42 48 Cores

  23. A scalability bottleneck 40 gmake Exim 35 Normalized throughput 30 25 20 15 10 5 0 1 6 12 18 24 30 36 42 48 Cores One contended cache line A single contended cache line can wreck scalability

  24. Cost of a contended cache line 25k 20k Cycles to read 15k 10k 5k 0 1 10 20 30 40 50 60 70 80 1 writer + N readers

  25. Cost of a contended cache line 25k 20k Cycles to read 15k 10k 5k open 0 1 10 20 30 40 50 60 70 80 1 writer + N readers

  26. What scales on today's multicores? Core X W R - W ✗ ✗ ✓ Core Y R ✗ ✓ ✓ - - ✓ ✓

  27. What scales on today's multicores? Core X W R - W ✗ ✗ ✓ Core Y R ✗ ✓ ✓ ✓ - - ✓ ✓

  28. What scales on today's multicores? Core X W R - W ✗ ✗ ✓ Core Y R ✗ ✗ ✓ ✓ - - ✓ ✓

  29. What scales on today's multicores? Core X W R - W ✗ ✗ ✓ Core Y R ✗ ✓ ✓ - - ✓ ✓ We say two or more operations are scalable if they are conflict-free .

  30. The intuition behind the rule Whenever interface operations commute, they can be implemented in a way that scales. Operations commute results independent of order ⇒ communication is unnecessary ⇒ without communication, no conflicts ⇒

  31. Formalizing the rule Y SI-commutes in X | | Y ≔ ∀ Y' ∈ reorderings( Y ), Z : X | | Y | | Z ∈ 𝒯 ⇔ X | | Y' | | Z ∈ 𝒯 . Y SIM-commutes in X | | Y ≔ ∀ P ∈ prefixes(reorderings( Y )): P SI-commutes in X | | P . An implementation m is a step function: state ⨯ inv ↦ state ⨯ resp . Given a specification 𝒯 , a history X | | Y in which Y SIM-commutes, and a reference implementation M that can generate X | | Y , ∃ an implementation m of 𝒯 whose steps in Y are conflict-free. Proof by simulation construction.

  32. Formalizing the rule Y SI-commutes in X | | Y ≔ ∀ Y' ∈ reorderings( Y ), Z : X | | Y | | Z ∈ 𝒯 ⇔ X | | Y' | | Z ∈ 𝒯 . Y SIM-commutes in X | | Y ≔ Commutativity is sensitive to ∀ P ∈ prefixes(reorderings( Y )): P SI-commutes in X | | P . operations, arguments, and state An implementation m is a step function: state ⨯ inv ↦ state ⨯ resp . Given a specification 𝒯 , a history X | | Y in which Y SIM-commutes, and a reference implementation M that can generate X | | Y , ∃ an implementation m of 𝒯 whose steps in Y are conflict-free. Proof by simulation construction.

  33. Example of using the rule Scalable implementation Commutes exists P1: creat ✗ P1: creat

  34. Example of using the rule Scalable implementation Commutes exists P1: creat ✗ P1: creat P1: creat("/tmp/x") P2: creat("/etc/y")

  35. Example of using the rule Scalable implementation Commutes exists P1: creat ✗ P1: creat P1: creat("/tmp/x") ✓ (Linux) ✓ P2: creat("/etc/y")

  36. Example of using the rule Scalable implementation Commutes exists P1: creat ✗ P1: creat P1: creat("/tmp/x") ✓ (Linux) ✓ P2: creat("/etc/y") P1: creat("/x") P2: creat("/y")

  37. Example of using the rule Scalable implementation Commutes exists P1: creat ✗ P1: creat P1: creat("/tmp/x") ✓ (Linux) ✓ P2: creat("/etc/y") P1: creat("/x") ✓ ✓ P2: creat("/y")

  38. Example of using the rule Scalable implementation Commutes exists P1: creat ✗ P1: creat P1: creat("/tmp/x") ✓ (Linux) ✓ P2: creat("/etc/y") P1: creat("/x") ✓ ✓ P2: creat("/y") P1: creat("x", O_EXCL) P2: creat("x", O_EXCL)

  39. Example of using the rule Scalable implementation Commutes exists P1: creat ✗ P1: creat P1: creat("/tmp/x") ✓ (Linux) ✓ P2: creat("/etc/y") P1: creat("/x") ✓ ✓ P2: creat("/y") P1: creat("x", O_EXCL) P2: creat("x", O_EXCL) Same CWD ✗ Different CWD ✓ ✓

  40. Applying the rule to real systems Interface specification (e.g., POSIX) Commuter Implementation (e.g., Linux) All scalability bottlenecks

  41. Input: Symbolic model SymInode = tstruct(data = tlist(SymByte), Symbolic model nlink = SymInt) SymIMap = tdict(SymInt, SymInode) SymFilename = tuninterpreted('Filename') SymDir = tdict(SymFilename, SymInt) class POSIX: def __init__(self): self.fname_to_inum = SymDir.any() self.inodes = SymIMap.any() @symargs(src=SymFilename, dst=SymFilename) def rename(self, src, dst): if src not in self.fname_to_inum: return (-1, errno.ENOENT) if src == dst: return 0 if dst in self.fname_to_inum: self.inodes[self.fname_to_inum[dst]].nlink -= 1 self.fname_to_inum[dst] = self.fname_to_inum[src] del self.fname_to_inum[src] return 0

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend