Improving IPC by Kernel Design
Jochen Liedtke
German National Research Center for Computer Science SOSP 1993 Presented by Bryon Nevis
10/14/2013 CS 533—Concepts of OS—Fall 2013 1
rev 10/15/2013
Kernel Design Jochen Liedtke German National Research Center for - - PowerPoint PPT Presentation
Improving IPC by Kernel Design Jochen Liedtke German National Research Center for Computer Science SOSP 1993 Presented by Bryon Nevis rev 10/15/2013 10/14/2013 CS 533 Concepts of OS Fall 2013 1 Summary L3 -kernel is 22X
Jochen Liedtke
German National Research Center for Computer Science SOSP 1993 Presented by Bryon Nevis
10/14/2013 CS 533—Concepts of OS—Fall 2013 1
rev 10/15/2013
10/14/2013 CS 533—Concepts of OS—Fall 2013 2
10/14/2013 CS 533—Concepts of OS—Fall 2013 3
10/14/2013 CS 533—Concepts of OS—Fall 2013 4
10/14/2013 CS 533—Concepts of OS—Fall 2013 5
10/14/2013 CS 533—Concepts of OS—Fall 2013 6
account for < 50% of actual L3 vs Mach performance difference
responsible?
– Mach ports & security? – Excessive modularity? – Lack of locality? – Use of expensive machine instructions?
10/15/2013 CS 533—Concepts of OS—Fall 2013 7
10/14/2013 CS 533—Concepts of OS—Fall 2013 8
10/14/2013 CS 533—Concepts of OS—Fall 2013 9
10/14/2013 CS 533—Concepts of OS—Fall 2013 10
10/14/2013 CS 533—Concepts of OS—Fall 2013 11
Cycles Remain Activity 10 68
5.5.3 - Check segment register validity (need to check CS,SS?); 4 or 5 segment registers @ 2 clocks each
7 61
5.3.1- Compute TCB from thread ID, verify thread ID in TCB
? ?
Save/restore registers while in kernel mode? (Since all GPR’s are used up in table 6.)
? ?
Check if FPU register or debug register used
? ?
Demux system call?
10/14/2013 CS 533—Concepts of OS—Fall 2013 12
The paper only accounts for only 17 of the remaining 78 cycles
10/14/2013 CS 533—Concepts of OS—Fall 2013 13
while (true) { msgsend(request) msgrcv(reply) /* compute */ }
while (true) { msgrcv(request) /* process */ msgsend(reply) }
10/14/2013 CS 533—Concepts of OS—Fall 2013 14
Note: mach_msg() can both send and receive too
10/14/2013 CS 533—Concepts of OS—Fall 2013 15
Block Unblock client Block server 5.3.5 Server does not block until all incomings are processed
10/14/2013 CS 533—Concepts of OS—Fall 2013 16
10/14/2013 CS 533—Concepts of OS—Fall 2013 17
10/14/2013 CS 533—Concepts of OS—Fall 2013 18
10/14/2013 CS 533—Concepts of OS—Fall 2013 19
Process A Kernel space Process B
10/14/2013 CS 533—Concepts of OS—Fall 2013 20
Process A Kernel space Process B SHM
Problems
LCK
10/14/2013 CS 533—Concepts of OS—Fall 2013 21
Process A Kernel space Process B SHM SHM 1 copy alias
5.2.3 Direct transfer by temporary mapping
– 1 PDE=4MB – Can flush all TLB
– TLB “window clean” algorithm
fault, interrupt; invalidate 4M of pages after thread switches (address space switches always flush TLB)
10/14/2013 CS 533—Concepts of OS—Fall 2013 22
10/14/2013 CS 533—Concepts of OS—Fall 2013 23 1 LRPC Paper
Note: This table accounts for all
x86 CPU’s
10/14/2013 CS 533—Concepts of OS—Fall 2013 24
10/14/2013 CS 533—Concepts of OS—Fall 2013 25
Ready Q HEAD • Waiting Q HEAD • Node Node Node Node
– Cost includes 4 TLB misses (if memory ops hit separate pages) – 7 memory ops to insert – 4 memory ops to remove
10/14/2013 CS 533—Concepts of OS—Fall 2013 26
10/15/2013 CS 533—Concepts of OS—Fall 2013 27
10/15/2013 CS 533—Concepts of OS—Fall 2013 28
10/15/2013 CS 533—Concepts of OS—Fall 2013 29
At 2:1 ratio 58 x 2 = 116 cycles per IPC savings At 5:1 ratio 58 x 5 = 290 cycles per IPC savings
10/14/2013 CS 533—Concepts of OS—Fall 2013 30
10/14/2013 CS 533—Concepts of OS—Fall 2013 31
10/14/2013 CS 533—Concepts of OS—Fall 2013 32
10/14/2013 CS 533—Concepts of OS—Fall 2013 33
10/14/2013 CS 533—Concepts of OS—Fall 2013 34
10/14/2013 CS 533—Concepts of OS—Fall 2013 35
10/14/2013 CS 533—Concepts of OS—Fall 2013 36
Section Cycles Description 5.2.1 344
2 system calls instead of 4
5.2.3 26-3092?
Copy message only once
5.3.2 10000’s?
Unknown cost of page fault while processing TCB’s
5.3.4 290
Lazy scheduler queue management
5.3.5 172?
172 defer context switch on reply
5.3.6 120
Use register messages
5.5.2 100
Avoid 11 TLB misses
10/14/2013 CS 533—Concepts of OS—Fall 2013 37
Note: For 7 of the 17 listed improvements, the actual improvement was not specifically quantified