Rethink the Sync! Rethink the Sync! Edmund B. Nightingale Kaushik - - PowerPoint PPT Presentation

rethink the sync rethink the sync
SMART_READER_LITE
LIVE PREVIEW

Rethink the Sync! Rethink the Sync! Edmund B. Nightingale Kaushik - - PowerPoint PPT Presentation

Rethink the Sync! Rethink the Sync! Edmund B. Nightingale Kaushik Veeraraghavan Peter M. Chen Jason Flinn University of Michigan Sync or Async Async? ? Sync or Desktop file systems typically use asynchronous I/O Advantages of


slide-1
SLIDE 1

Rethink the Sync! Rethink the Sync!

Edmund B. Nightingale Kaushik Veeraraghavan Peter M. Chen Jason Flinn University of Michigan

slide-2
SLIDE 2

Rethink the Sync!

Sync or Sync or Async Async? ?

  • Desktop file systems typically use asynchronous I/O
  • Advantages of synchronous file I/O:

– Cleaner abstraction – Any output seen by user is durable – Application programming is easier

  • Disadvantage of synchronous file I/O: Slow!
  • Need new model: visible synchrony
slide-3
SLIDE 3

Rethink the Sync!

Visible Synchrony Visible Synchrony

  • Synchronous file operation guarantees:

– Ordering: if A happens before B, effects of B not visible unless the effects of A also visible. – Durability: any operation that is observed to complete is already committed to disk.

  • Current OSes provide guarantees to applications.

– Do not return from system call until data committed.

Idea: provide guarantees to external observers instead!

slide-4
SLIDE 4

Rethink the Sync!

Ordering and Durability Ordering and Durability

  • Ordering: commit operations in temporal order

– Use ext3 in data journaling mode.

  • Durability:

– File system operations return immediately but taint process. – OS buffers (uncommitted) output from tainted processes. – When data commits, OS removes taint, releases output. – OS tracks taint spread through IPC, shared memory, etc.

slide-5
SLIDE 5

Rethink the Sync!

Synchronous I/O Synchronous I/O

Application OS Output: “wrote B” Write A Write B Commit A Commit B

Slow! Many synchronous disk writes

slide-6
SLIDE 6

Rethink the Sync!

Visibly Synchronous I/O Visibly Synchronous I/O

Application OS Output: “Wrote B” Write B Commit A Commit B Write A Much faster (with a few more tricks)

Buffer until committed

slide-7
SLIDE 7

Rethink the Sync!

Results: Linux 2.4 kernel Results: Linux 2.4 kernel

(8%) 204x 16x

  • (overhead)

8.8 s. 1661 s. 132 s. 8.1 s. PostMark (4%) 12x (59%)

  • (overhead)

1:50 21:27 2:20 1:46 Apache Build Yes Yes Not power loss No after fsync? Yes Yes Not power loss No Durable? Synchrony (barriers) (default) Visible Sync Sync Async

Visible synchrony: durability with low overhead! Users see behavior equivalent to synchronous I/O No application modification required.

slide-8
SLIDE 8

Rethink the Sync!

Latency vs. Throughput Latency vs. Throughput

Application OS Output: “Wrote B” Write B Write A

Don’t commit yet! User not waiting For output

Commit A+B

Group commit when

  • utput buffered

Idea: Optimize for latency or throughput based upon visibility.

Buffer until committed