Professional Documents
Culture Documents
2
Range Locks
{
EOF
{ {
3
{ BOF
Linux kernel Scalability Bottleneck
4
Existing Range Locks
[16-21]
• Auxiliary red-black tree
0 1
VMA
[5-20]
VMA 2 [30-60]
VMA 4
• Protected by spin-lock
1 0
5
Existing Range Locks
Current RL
are not [16-21]
• scalable
Auxiliary red-black tree
0 1
VMA
[5-20]
VMA 2 [30-60]
VMA 4
• Protected by spin-lock
1 0
6
Our Contributions
7
List-based Range Locks
8
List-based Range Locks
R
List Head [30-60]
CAS CAS
[5–20] [16-21]
9
List-based Range Locks
R
List Head [16-21] [30-60]
[5–20]
10
List-based Range Locks
[15–45] [30–35]
11
List-based Range Locks
[15–45] [30–35]
12
VM Management in the Kernel
0xffffffffff
Virtual
Address
Space
0x00000000
13
VM Management in the Kernel
0xffffffffff
VMA 1
start:
length:
Access rights:
READ|WRITE
VMA 2
start:
length: VMA 3
Access rights: start:
READ|WRITE length:
Access rights:
NONE
Virtual
Address
Space
0x00000000
14
VM Management in the Kernel
0xffffffffff
VMA 1
VMA 1
VMA 1 mm_rb
start:
length:
Access rights: VMA 2 VMA 4
VMA 3 VMA 2
READ|WRITE
VMA 2
start:
length: VMA 3
Access rights: start:
READ|WRITE length:
Access rights:
NONE
Virtual
Address
Space
0x00000000
15
VM Management in the Kernel
0xffffffffff
Virtual
Address
Space
0x00000000
16
VM Management in the Kernel
0xffffffffff
0x00000000
17
Refined Ranges for VM
18
Refined Ranges for VM
19
Refined Ranges for VM
20
Refined Ranges for VM
VM_Operation(start, length, args..){
Acquire_mm_sem();
Acquire_RL_Read(start, start+length);
Protect with VMA = find_vma(start);
range lock of Release_RL();
input range // operation logic
…
read_only operations
Decide if structural modification is required
…
Release_mm_sem();
}
21
Refined Ranges for VM
VM_Operation(start, length, args..){
Acquire_mm_sem();
Acquire_RL_Read(start, start+length);
VMA = find_vma(start);
Release_RL();
Acquire_RL_Write(VMA.start-x, VMA.end+x);
// operation logic
Protect with range …
lock of VMA range+Δ read_only operations
Decide if structural modification is required
…
Release_RL();
Acquire_RL_Write(0,263-1);
range lock and retry();
retry }
…
Release_RL();
Release_mm_sem();
}
23
Evaluation
• Linux kernel 4.16.0-rc2
• Baselines:
• Stock
} 9x
25
Evaluation
Collected using
lock_stats
26
More in the paper…
• Evaluation:
• More workloads
• User-space applications
27
Conclusion
28