• No results found

[537] Final Review. Tyler Harter 12/14/14

N/A
N/A
Protected

Academic year: 2021

Share "[537] Final Review. Tyler Harter 12/14/14"

Copied!
269
0
0

Loading.... (view fulltext now)

Full text

(1)

[537] Final Review

Tyler Harter 12/14/14

(2)
(3)

How do we share?

CPU?

Memory? Disk?

(4)

How do we share?

CPU? (a: time sharing)

Memory? (a: space sharing) Disk? (a: space sharing)

(5)

How do we share?

CPU? (a: time sharing) TODAY

Memory? (a: space sharing) Disk? (a: space sharing)

Goal: processes should NOT even know they are sharing (each process will get its own virtual CPU)

(6)

What to Do with Processes

That Are Not Running?

A: store context in OS struct Look in kernel/proc.h


context (CPU registers)


ofile (file descriptors)


(7)

State Transitions

Running Ready

Blocked

Scheduled Descheduled

(8)
(9)

CPU Time Sharing

Goal 1: efficiency


OS should have minimal overheard Goal 2: control


Processes shouldn’t do anything bad


OS should decide when processes run Solution: limited direct execution

(10)

What to limit?

General memory access Disk I/O

Special x86 instructions like lidt!

(11)

What to limit?

General memory access Disk I/O

Special x86 instructions like lidt!

(12)

RAM Process P

trap-table index syscall-table index

lidt example

(13)

RAM Process P

trap-table index syscall-table index

P tries to call lidt!

lidt example

(14)

RAM

trap-table index syscall-table index

CPU warns OS, OS kills P

goodbye, P

(15)

Context Switch

Problem: when to switch process contexts?

Direct execution => OS can’t run while process runs

How can the OS do anything while it’s not running?


A: it can’t

(16)
(17)

Scheduling Basics

Metrics:
 turnaround_time
 response_time
 Schedulers:
 FIFO
 SJF
 STCF
 RR Workloads:
 arrival_time
 run_time

(18)

Workloads

Arrival: time at which scheduler is aware of job

Run time: how long does it take if run beginning to end?

(19)

Schedulers

FIFO: first in, first out

SJF: shortest job first (not preemptive) STCF: shortest time to completion first RR: round robin

(20)

Turnaround Time

0 20 40 60 80

What is the average turnaround time? (Q1)

!

(10 + 20 + 30) / 3 = 20s

A: 10s B: 20s C: 30s

(21)

FIFO vs. RR (Q5) — which is each?

0 5 10 15 20

0 5 10 15 20

A B C

ABC…

Avg Response Time? Q5

Avg Response Time? Q5

(22)

0 5 10 15 20

0 5 10 15 20

A B C

ABC…

Avg Response Time? (0+1+2)/3 = 1

Avg Response Time? (0+5+10)/3 = 5

(23)
(24)

Match that Segment!

int x;

int main(int argc, char *argv[]) {

int y;

int *z = malloc(sizeof(int)););

} x main y z code data heap stack

(25)

Match that Segment!

int x;

int main(int argc, char *argv[]) {

int y;

int *z = malloc(sizeof(int)););

} x main y z code data heap stack

(26)

P1 P2 4 KB 5 KB 6 KB 2 KB 3 KB 1 KB 0 KB same code

(27)

P1 P2 4 KB 5 KB 6 KB 2 KB 3 KB 1 KB 0 KB base register P1 is running

(28)

P1 P2 4 KB 5 KB 6 KB 2 KB 3 KB 1 KB 0 KB base register P2 is running

(29)

(free) Program Code Heap 0 KB 1 KB 2 KB 15 KB Stack 16 KB wasted space

(30)

Multi-segment translation

One (correct) approach:


- break virtual addresses into two parts
 - one part indicates segment


(31)
(32)

Paging

Segmentation is too coarse-grained.


Either waste space OR memcpy often.

We need a fine-grained alternative!


Paging idea:


- break mem into small, fix-sized chunks (aka pages)


- each virt page is independently mapped to a phys page


(33)

Virt => Phys Mapping

For segmentation, we used a formula
 (e.g., phys = virt_offset + base_reg)

Now, we need a more


general mapping mechanism. What data structure is good?
 Big array, called a pagetable

0 1 0 1 0 1 VPN offset 1 1 0 1 0 1 1 0 PPN offset Addr Mapper

(34)

Where Are Pagetable’s Stored?

How big is a typical page table?
 - assume 32-bit address space
 - assume 4 KB pages


- assume 4 byte entries (or this could be less)
 - 2 ^ (32 - log(4KB)) * 4 = 4 MB!

Store in memory.


(35)

Other PT info

What other data should go in pagetable entries besides translation? - valid bit
 - protection bits
 - present bit
 - reference bit
 - dirty bit

(36)
(37)

Translation Steps

H/W: for each mem reference:


1. extract VPN (virt page num) from VA (virt addr)


2. calculate addr of PTE (page table entry)


3. fetch PTE

4. extract PFN (page frame num)


5. build PA (phys addr)


6. fetch PA to register

Which expensive step can we avoid?

(cheap) (cheap) (cheap) (cheap) (expensive) (expensive)

(38)

Array Iterator

int sum = 0;


for (i=0; i<N; i++) {


! sum += a[i];


(39)

Array Iterator

load 0x3000
 
 load 0x3004
 
 load 0x3008
 
 load 0x300C
 … Virt

(40)

Array Iterator

load 0x3000
 
 load 0x3004
 
 load 0x3008
 
 load 0x300C
 … load 0x100C
 load 0x7000
 load 0x100C
 load 0x7004
 load 0x100C
 load 0x7008
 load 0x100C
 load 0x700C Virt Phys

(41)

Array Iterator

load 0x3000
 
 load 0x3004
 
 load 0x3008
 
 load 0x300C
 … load 0x100C
 load 0x7000
 load 0x100C
 load 0x7004
 load 0x100C
 load 0x7008
 load 0x100C
 load 0x700C Virt Phys

(42)

Array Iterator

load 0x3000
 
 load 0x3004
 
 load 0x3008
 
 load 0x300C
 … load 0x100C
 load 0x7000
 load 0x100C
 load 0x7004
 load 0x100C
 load 0x7008
 load 0x100C
 load 0x700C Virt Phys

(43)

Array Iterator

load 0x3000
 
 load 0x3004
 
 load 0x3008
 
 load 0x300C
 … load 0x100C
 load 0x7000
 load 0x100C
 load 0x7004
 load 0x100C
 load 0x7008
 load 0x100C
 load 0x700C Virt Phys

(44)

time addr ess Workload A time addr ess Workload B … …

(45)

A

ddress

S

pace

Id

entifier

Tag each TLB entry with an 8-bit ASID
 - how many ASIDs to we get?


- why not use PIDs?


(46)

Security

Modifying TLB entries is privileged
 - otherwise what could you do?

Need same protection bits in TLB as pagetable
 - rwx

(47)
(48)

Motivation

Why do we want big virtual address spaces?


- programming is easier


- applications need not worry (as much) about fragmentation

Paging goals:


- space efficiency (don’t waste on invalid data)


(49)

code heap

stack

Virt Mem Phys Mem

(50)

Many invalid PT entries

PFN valid prot 10 1 r-x - 0 - 23 1 rw- - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - 28 1 rw- 4 1 rw-

(51)

Multi-Level Page Tables

Idea: break PT itself into pages


- a page directory refers to pieces


- only have pieces with >0 valid entries Used by x86. PT idx 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 17 OFFSET 18 19 PD idx VPN

(52)

>2 Levels

Problem: page directories may not fit in a page Solution: split page directories into pieces.


Use another page dir to refer to the page dir pieces.

PT idx 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 17 OFFSET 18 19 PD idx 1 VPN PD idx 0 20 21 22 23

(53)
(54)

Cache

Upon access, we must load the desired page. Do we prefetch other adjacent pages?


(remember disks have high fixed costs)

Prefetching more means we will have to evict more. What to evict?

(55)

FIFO

(56)

Access Hit State (after) 1 no 1 2 no 1,2 3 no 1,2,3 4 no 2,3,4 1 no 3,4,1 2 no 4,1,2 5 no 1,2,5 1 yes 1,2,5 2 yes 1,2,5 3 no 2,5,3 4 no 5,3,4 5 yes 5,3,4

(a) size 3 (b) size 4

Access Hit State (after) 1 no 1 2 no 1,2 3 no 1,2,3 4 no 1,2,3,4 1 yes 1,2,3,4 2 yes 1,2,3,4 5 no 2,3,4,5 1 no 3,4,5,1 2 no 4,5,1,2 3 no 5,1,2,3 4 no 1,2,3,4 5 no 2,3,4,5 Belady’s Anomaly

(57)

LRU, MRU

LRU: evict least-recently used
 - consider history

!

(58)

Discuss

Can Belady’s anomaly happen with LRU?

!

(59)

LRU Hardware Support

What is needed?

!

(60)

LRU Hardware Support

What is needed?

!

Timestamps. Why can’t OS alone track this?

!

Cheap approximation: reference (or use) bits. - set upon access, cleared by OS

(61)

Thrashing

A machine is thrashing when there is not enough RAM, and we constantly swap in/out pages

!

Solutions?

- admission control (like scheduler project) - buy more memory

(62)
(63)

Strategy 2

New abstraction: the thread.

!

Threads are just like processes, but they

(64)

CPU 1 CPU 2 running thread 1 running thread 2 RAM

(65)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B …

(66)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B … PTBR PTBR

(67)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B … PTBR PTBR

(68)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B … PTBR PTBR IP IP

(69)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B … PTBR PTBR CODE HEAP Virt Mem (PageDir A) IP IP

(70)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B … PTBR PTBR CODE HEAP Virt Mem (PageDir A) IP IP

Each thread may be executing

(71)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B … PTBR PTBR CODE HEAP Virt Mem (PageDir A) IP IP

(72)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B … PTBR PTBR CODE HEAP Virt Mem (PageDir A) IP SP IP SP

(73)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B … PTBR PTBR CODE HEAP Virt Mem (PageDir A) IP SP IP SP STACK 1 STACK 2

(74)

CPU 1 CPU 2 running thread 1 running thread 2 RAM PageDir A PageDir B … PTBR PTBR CODE HEAP Virt Mem (PageDir A) IP SP IP SP STACK 1 STACK 2

(75)
(76)

Lock Goals

Correctness ! Fairness ! Performance

(77)

Test-and-set Spinlock

void SpinLock(volatile unsigned int *lock) {

while (xchg(lock, 1) == 1)

; // spin

}

!

void SpinUnlock(volatile unsigned int *lock) { xchg(lock, 0);

(78)

Test-and-set Spinlock (optimized)

void SpinLock(volatile unsigned int *lock) {

while (xchg(lock, 1) == 1)

; // spin

}

!

void SpinUnlock(volatile unsigned int *lock) { *lock = 0;

(79)

Test-and-set Spinlock (optimized)

void SpinLock(volatile unsigned int *lock) {

while (xchg(lock, 1) == 1)

; // spin

}

!

void SpinUnlock(volatile unsigned int *lock) { *lock = 0;

}

Works on newer x86 processors.

(80)

spin spin spin spin

Basic Spinlocks are Unfair

A B

0 20 40 60 80 100 120 140 160

A B A B A B

lock

lock

(81)

spin

spin spin spin spin

CPU Scheduler is Ignorant

A B

0 20 40 60 80 100 120 140 160

C D A B C D

lock unlock lock

CPU scheduler may run B instead of A

(82)

Chapters 30: condition variables

(and sleeping locks)

(83)

Queue Lock

RUNNABLE: RUNNING: WAITING: A, B, C, D <empty> <empty> 0 20 40 60 80 100 120 140 160

(84)

Queue Lock

RUNNABLE: RUNNING: WAITING: B, C, D A <empty> 0 20 40 60 80 100 120 140 160 A lock

(85)

Queue Lock

RUNNABLE: RUNNING: WAITING: C, D, A B <empty> 0 20 40 60 80 100 120 140 160 A lock B

(86)

Queue Lock

RUNNABLE: RUNNING: WAITING: C, D, A B 0 20 40 60 80 100 120 140 160 A lock B try lock (sleep)

(87)

Queue Lock

RUNNABLE: RUNNING: WAITING: D, A C B 0 20 40 60 80 100 120 140 160 A lock B try lock (sleep) C

(88)

Queue Lock

RUNNABLE: RUNNING: WAITING: A, C D B 0 20 40 60 80 100 120 140 160 A lock B try lock (sleep) C D

(89)

Queue Lock

RUNNABLE: RUNNING: WAITING: A, C B, D 0 20 40 60 80 100 120 140 160 A lock B try lock (sleep) C D try lock (sleep)

(90)

Queue Lock

RUNNABLE: RUNNING: WAITING: C A B, D 0 20 40 60 80 100 120 140 160 A lock B try lock (sleep) C D try lock (sleep) A

(91)

Queue Lock

RUNNABLE: RUNNING: WAITING: A C B, D 0 20 40 60 80 100 120 140 160 A lock B try lock (sleep) C D try lock (sleep) A C

(92)

Queue Lock

RUNNABLE: RUNNING: WAITING: C A B, D 0 20 40 60 80 100 120 140 160 A lock B try lock (sleep) C D try lock (sleep) A C A

(93)

Queue Lock

0 20 40 60 80 100 120 140 160 A lock B try lock (sleep) C D try lock (sleep) A C A unlock RUNNABLE: RUNNING: WAITING: B, C A D

(94)

Queue Lock

RUNNABLE: RUNNING: WAITING: B, C A D 0 20 40 60 80 100 120 140 160 A lock B try lock (sleep) C D try lock (sleep) A C A unlock

(95)

Queue Lock

RUNNABLE: RUNNING: WAITING: C, A B D 0 20 40 60 80 100 120 140 160 A lock B try lock (sleep) C D try lock (sleep) A C A unlock B lock

(96)

Concurrency Objectives

Mutual exclusion (e.g., A and B don’t run at same time) - solved with locks

!

Ordering (e.g., B runs after A) - solved with condition variables

(97)

Correct CV’s

wait(cond_t *cv, mutex_t *lock)

- assumes the lock is held when wait() is called

- puts caller to sleep + releases the lock (atomically) - when awoken, reacquires lock before returning

!

signal(cond_t *cv)

- wake a single waiting thread (if >= 1 thread is waiting)

- if there is no waiting thread, just return w/o doing anything

requires kernel support!

(98)

Produce/Consumer

Pipes Web servers Memory allocators Device I/O … !

General strategy: use condition variables to make

consumers wait when there is nothing to consume,

(99)

What about 2 consumers (v1)?

Producer: p1 p2 p4 p5 p6 p1 p2 p3

Consumer1: c1 c2 c3

Consumer2: c1 c2 c3 c2 c4 c5

wait()

wait() wait() signal() signal()

(100)

What about 2 consumers (v1)?

Producer: p1 p2 p4 p5 p6 p1 p2 p3

Consumer1: c1 c2 c3

Consumer2: c1 c2 c3 c2 c4 c5

wait()

wait() wait() signal() signal()

does this wake producer or consumer2?

(101)

How to wake the right thread?

One solution: ! ! ! ! ! !

Better solution (usually): use two condition variables. wake all the threads!

(102)
(103)

CV’s vs. Semaphores

CV rules of thumb:

- Keep state in addition to CV’s

- Always do wait/signal with lock held

- Whenever you acquire a lock, recheck state

!

(104)

Thread Queue: Signal Queue:

Condition Variable (CV)

Semaphore

(105)

Thread Queue: Signal Queue: A wait() Condition Variable (CV) Semaphore Thread Queue: A

(106)

Thread Queue: Signal Queue: A Condition Variable (CV) Semaphore Thread Queue: A

(107)

Thread Queue: Signal Queue: A Condition Variable (CV) Semaphore Thread Queue: A signal()

(108)

Thread Queue: Signal Queue:

Condition Variable (CV)

Semaphore

Thread Queue:

(109)

Thread Queue: Signal Queue:

Condition Variable (CV)

Semaphore

(110)

Thread Queue: Signal Queue: Condition Variable (CV) Semaphore Thread Queue: signal() signal

(111)

Thread Queue: Signal Queue:

Condition Variable (CV)

Semaphore

Thread Queue:

(112)

Thread Queue: Signal Queue: Condition Variable (CV) Semaphore Thread Queue: signal wait() B B

(113)

Thread Queue: Signal Queue: Condition Variable (CV) Semaphore Thread Queue: wait() B

(114)

Thread Queue: Signal Queue:

Condition Variable (CV)

Semaphore

Thread Queue:

(115)

Thread Queue: Signal Queue:

Condition Variable (CV)

Semaphore

Thread Queue:

B may wait forever

(116)

Thread Queue: Signal Queue:

Condition Variable (CV)

Semaphore

Thread Queue:

B may wait forever

(if not careful)

(117)
(118)

Platter

(119)
(120)
(121)

Surface

(122)
(123)
(124)

Each surface is divided into rings called tracks.

(125)

The tracks are divided into numbered sectors. 1 2 3 0 6 5 4 7 8 9 10 11 15 14 13 12 16 17 18 19 23 22 21 20

(126)

Heads on a moving arm can read from each surface. 1 2 3 0 6 5 4 7 8 9 10 11 15 14 13 12 16 17 18 19 23 22 21 20

(127)

1 2 3 0 6 5 4 7 8 9 10 11 15 14 13 12 16 17 18 19 23 22 21 20 spin

(128)

Workload

So…

- seeks are slow

- rotations are slow - transfers are fast

!

What kind of workload is fastest for disks?

Sequential: access sectors in order (transfer dominated)

(129)

Other Improvements

Track Skew ! Zones ! Cache

(130)

Other Improvements

Track Skew ! Zones ! Cache

(131)

8 9 10 11 15 14 13 12 16 17 18 19 23 22 21 20

(132)

8 9 10 11 15 14 13 12 16 17 18 19 23 22 21 20

When reading 16 after 15, the head won’t settle quick enough, so we need to do a rotation.

(133)

8 9 10 11 15 14 13 12 23 23 16 17 21 20 19 18

(134)

8 9 10 11 15 14 13 12 23 23 16 17 21 20 19 18

(135)

Other Improvements

Track Skew ! Zones ! Cache

(136)
(137)
(138)
(139)
(140)

Other Improvements

Track Skew ! Zones ! Cache

(141)

Drive Cache

Drives may cache both reads and writes.

!

OS does this to.

!

What advantage does drive have for reads?

!

(142)

Schedulers

OS

(143)

Schedulers

OS

Disk

Scheduler

Scheduler

Where should the scheduler go?

(144)

SPTF (Shortest Positioning Time First)

Strategy: always choose the request that will take the least time for seeking and rotating.

!

How to implement in disk? How to implement in OS?

(145)

SPTF (Shortest Positioning Time First)

Strategy: always choose the request that will take the least time for seeking and rotating.

!

How to implement in disk? How to implement in OS?

!

(146)

SCAN

Sweep back and forth, from one end of disk to the other, serving requests as you go.

!

(147)

SCAN

Sweep back and forth, from one end of disk to the other, serving requests as you go.

!

Pros/Cons?

!

Better: C-SCAN (circular scan) - only sweep in one direction

(148)
(149)

All RAID

Reliability Capacity RAID-0 0 C*N RAID-1 1 C*N/2 RAID-4 1 N-1 RAID-5 1 N-1

(150)

All RAID

Read Latency Write Latency

RAID-0 D D

RAID-1 D D

RAID-4 D 2D

(151)

All RAID

Read Latency Write Latency

RAID-0 D D

RAID-1 D D

RAID-4 D 2D

RAID-5 D 2D

but RAID-5 can do more in parallel

(152)

All RAID

Seq Read Seq Write Rand Read Rand Write RAID-0 N * S N * S N * R N * R

RAID-1 N/2 * S N/2 * S N * R N/2 * R RAID-4 (N-1)*S (N-1)*S (N-1)*R R/2 RAID-5 (N-1)*S (N-1)*S N * R N/4 * R

(153)

All RAID

Seq Read Seq Write Rand Read Rand Write RAID-0 N * S N * S N * R N * R

RAID-1 N/2 * S N/2 * S N * R N/2 * R RAID-4 (N-1)*S (N-1)*S (N-1)*R R/2 RAID-5 (N-1)*S (N-1)*S N * R N/4 * R

(154)

All RAID

Seq Read Seq Write Rand Read Rand Write RAID-0 N * S N * S N * R N * R

RAID-1 N/2 * S N/2 * S N * R N/2 * R RAID-5 (N-1)*S (N-1)*S N * R N/4 * R

(155)

All RAID

Seq Read Seq Write Rand Read Rand Write RAID-0 N * S N * S N * R N * R

RAID-1 N/2 * S N/2 * S N * R N/2 * R RAID-5 (N-1)*S (N-1)*S N * R N/4 * R

RAID-0 is always fastest and has best capacity. (but at cost of reliability)

(156)

All RAID

Seq Read Seq Write Rand Read Rand Write RAID-0 N * S N * S N * R N * R

RAID-1 N/2 * S N/2 * S N * R N/2 * R RAID-5 (N-1)*S (N-1)*S N * R N/4 * R

(157)

All RAID

Seq Read Seq Write Rand Read Rand Write RAID-0 N * S N * S N * R N * R

RAID-1 N/2 * S N/2 * S N * R N/2 * R RAID-5 (N-1)*S (N-1)*S N * R N/4 * R

(158)

All RAID

Seq Read Seq Write Rand Read Rand Write RAID-0 N * S N * S N * R N * R

RAID-1 N/2 * S N/2 * S N * R N/2 * R RAID-5 (N-1)*S (N-1)*S N * R N/4 * R

(159)

All RAID

Seq Read Seq Write Rand Read Rand Write RAID-0 N * S N * S N * R N * R

RAID-1 N/2 * S N/2 * S N * R N/2 * R

RAID-5 (N-1)*S (N-1)*S N * R N/4 * R

(160)
(161)

File Names

Three types of names:

- inode - path

(162)

Atomic File Update

Say we want to update file.txt.

!

1. write new data to new file.txt.tmp file 2. fsync file.txt.tmp

(163)

Chapters 41: FFS

Treat a disk like a disk!

!

Place related data together: hopefully makes future reads faster.

(164)

Data Blocks super block inodes 0 N

Technique 2: Groups

bitmaps

before: whole disk fast

(165)

Data Blocks super block inodes 0 N

Technique 2: Groups

bitmaps

before: whole disk slow

(166)

Data Blocks super block inodes 0 N

Technique 2: Groups

bitmaps

before: whole disk

(167)

Data Blocks super block inodes 0 N

Technique 2: Groups

bitmaps

before: whole disk

(168)

Data Blocks super block inodes 0 N

Technique 2: Groups

bitmaps

(169)

Data Blocks super block inodes 0 G

Technique 2: Groups

bitmaps

(170)

Technique 2: Groups

D S B I zoom out group 1 0 G D S B I 2G D S B I 3G group 2 group 3

(171)

Technique 2: Groups

D S B I

strategy: allocate inodes and data blocks in same group.

group 1 0 G D S B I 2G D S B I 3G group 2 group 3

(172)

inode dir file inode dir inode B1 B2 Ind B1 B2 many pointer related B3 B4 break br eak Allocation Policy

(173)
(174)

Redundancy

Definition: if A and B are two pieces of data, and

knowing A eliminates some or all the values B could

B, there is redundancy between A and B.

!

RAID examples:

- mirrored disk (complete redundancy) - parity blocks (partial redundancy)

(175)

Problem 3

Give 5 examples of redundancy in FFS (or files systems in general).

(176)

Problem 3

Give 5 examples of redundancy in FFS (or files systems in general).

!

Dir entries AND inode table.

Dir entries AND inode link count. Data bitmap AND inode pointers.

Data bitmap AND group descriptor.

Inode file size AND inode/indirect pointers. …

(177)

fsck

FSCK = file system checker.

!

Strategy: after a crash, scan whole disk for contradictions.

!

For example, is a bitmap block correct?

!

Read every valid inode+indirect. If an inode points to a block, the corresponding bit should be 1

(178)

Journal: General Strategy

Never delete ANY old data, until,

ALL new data is safely on disk.

!

Ironically, this means we’re adding redundancy to fix the problem caused by redundancy.

(179)

New Layout

0 5 0 6 11 12 1 2 3 4 7 8 9 10 journal

(180)

New Layout

0 5 0 6 11 12 1 2 3 4 7 8 9 10 journal

(181)

New Layout

0 5 5,2 0 6 11 12 1 2 3 4 7 8 9 10 journal

(182)

New Layout

0 5 5,2 A 0 6 11 12 1 2 3 4 7 8 9 10 journal

(183)

New Layout

0 5 5,2 A B 0 6 11 12 1 2 3 4 7 8 9 10 journal

(184)

New Layout

0 5 5,2 A B 1 6 11 12 1 2 3 4 7 8 9 10 journal

(185)

New Layout

A 0 5 5,2 A B 1 6 11 12 1 2 3 4 7 8 9 10 journal

(186)

New Layout

A 0 5 B 5,2 A B 1 6 11 12 1 2 3 4 7 8 9 10 journal

(187)

New Layout

A 0 5 B 5,2 A B 0 6 11 12 1 2 3 4 7 8 9 10 journal

(188)

Optimizations

1. Reuse small area for journal

2. Barriers

3. Checksums

4. Circular journal 5. Logical journal

(189)

Chapters 43: LFS

Write data fastest way possible… Sequentially!

!

(190)

Big Picture

buffer:

(191)

Big Picture

buffer:

(192)

Big Picture

buffer:

(193)

Big Picture

buffer:

(194)

Big Picture

buffer:

(195)

Big Picture

buffer:

(196)

Big Picture

buffer:

(197)

Big Picture

buffer:

(198)

Big Picture

buffer:

(199)

Big Picture

buffer:

(200)

Big Picture

buffer:

References

Related documents

Studies show that according to the understanding situation, knowledge used may be related to different kind of information: data flow relations, functional relations

– Total number of inodes – Filesystem size in blocks – Free block counter – Free inode counter – Block size. – Blocks per group – Inodes

Adjust the connected televisions input setting to match the input used in the previous step.. Coaxial Digital

The „3rd European Seminar on Precision Optics Manufacturing“ continues to confi rm the importance attached to research, innovation and internationalization at the Deggendorf

Engineering Service Agency (Name &amp; Contact Info): Program Manager (Name &amp; Contact Info): TROOP SUPPORT Customer Relationship Manager (CRM) Team Lead: Date

2. Speaker and Speech Recognition. Speaker recognition is the automatic verification of a speaker’s identity from a voice recording of this speaker. Speaker recogni- tion differs

Oils from almond seed, and castor seed in addition to palm oil, and groundnut oil due to their high oil yield and abundance may be considered as Nigeria potential

Aim To present a case where a traumatized, immature tooth still showed capacity for continued root development and apexogenesis after root canal treatment was initiated based on