Hardware Supported Permission Checks On Persistent Objects for Performance and Programmability
Tiancong Wang, Sakthikumaran Sambasivam, James Tuck twang14@ncsu.edu or jtuck@ncsu.edu
1
Hardware Supported Permission Checks On Persistent Objects for - - PowerPoint PPT Presentation
Hardware Supported Permission Checks On Persistent Objects for Performance and Programmability Tiancong Wang, Sakthikumaran Sambasivam, James Tuck twang14@ncsu.edu or jtuck@ncsu.edu 1 NVM Programming 2 NVM Programming
1
2
NVMM
2
NVMM
2
regions, a.k.a. pools
NVMM Pool 1 Pool 2
2
regions, a.k.a. pools
to create persistent data structure
Address Space
text data BSS heap stack
NVMM Pool 1 Pool 2
2
regions, a.k.a. pools
to create persistent data structure
linked data structures
Address Space
text data BSS heap stack
NVMM Pool 1 Pool 2
2
regions, a.k.a. pools
to create persistent data structure
linked data structures
pools
Address Space
text data BSS heap stack
NVMM Pool 1 Pool 2
2
Address Space
text data BSS heap stack
Program 1 NVMM Pool 1 Pool 2
3
Address Space
text data BSS heap stack
Program 1
the same data structure NVMM Pool 1 Pool 2
3
Address Space
text data BSS heap stack
Program 2
Address Space
text data BSS heap stack
Program 1
the same data structure ★Is the permanent pointer still valid? NVMM Pool 1 Pool 2
3
Address Space
text data BSS heap stack
? Program 2
Address Space
text data BSS heap stack
Program 1
the same data structure ★Is the permanent pointer still valid?
accessing it. NVMM Pool 1 Pool 2
3
Address Space
text data BSS heap stack
? Program 2
Address Space
text data BSS heap stack
Program 1
the same data structure ★Is the permanent pointer still valid?
accessing it.
permissions; need to check the permission before mapping NVMM Pool 1 Pool 2
3
Address Space
text data BSS heap stack
? Program 2
Address Space
text data BSS heap stack
Program 1
the same data structure ★Is the permanent pointer still valid?
accessing it.
permissions; need to check the permission before mapping ★We need to validate on ALL permanent pointers before dereferencing, to make sure the pool is checked and mapped NVMM Pool 1 Pool 2
3
Address Space
text data BSS heap stack
? Program 2
Address Space
text data BSS heap stack
Program 1
the same data structure ★Is the permanent pointer still valid?
accessing it.
permissions; need to check the permission before mapping ★We need to validate on ALL permanent pointers before dereferencing, to make sure the pool is checked and mapped NVMM Pool 1 Pool 2
3
Address Space
text data BSS heap stack
? Program 2 Performance overhead Programming burden
(SPOT)
system table.
permission information
physical addresses
reason about permanent pointers as long as the program has permissions Pool ID Physical addr. Permission info
5
5
5
5
5
5
6
7
Pool ID Base address 1234 0xDEADBEEF 5678 0x12345678 … … Pool ID Offset Object ID
Pool ID Base address 1234 0xDEADBEEF 5678 0x12345678 … … Hash Table search + Pool ID Offset Object ID 5678 Translated address
Pool ID Base address 1234 0xDEADBEEF 5678 0x12345678 … … Hash Table search + Pool ID Offset Object ID 5678 Translated address
Address Space
text data BSS heap stack
Pool 1 Pool 2
Address Space
text data BSS heap stack
Pool 1 Pool 2
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1(1, 10) Check&Map Pool 1
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1 addr1 = translate oid1 (1, 10)
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1 addr1 = translate oid1
(1, 20)
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1 addr1 = translate oid1
check oid2 (1, 20)
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2 (1, 20)
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2
(2, 20)
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2
check oid3(2, 20) Check&Map Pool 2
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2
check oid3 addr3 = translate oid3 (2, 20)
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2
check oid3 addr3 = translate oid3 load from addr3 (2, 20)
Address Space
text data BSS heap stack
Pool 1 Pool 2
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2
check oid3 addr3 = translate oid3 load from addr3
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2
check oid3 addr3 = translate oid3 load from addr3 Routine to access on ObjectID:
similar to memory-mapped files (kernel-level operation)
check oid1; (1,10)
similar to memory-mapped files (kernel-level operation)
check oid1; (1,10)
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2
check oid3 addr3 = translate oid3 load from addr3
leaving to programmers
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2
check oid3 addr3 = translate oid3 load from addr3
leaving to programmers
pools with names at the beginning of the program -> eliminates performance overhead
check oid1 addr1 = translate oid1
check oid2 addr2 = translate oid2
check oid3 addr3 = translate oid3 load from addr3
leaving to programmers
pools with names at the beginning of the program -> eliminates performance overhead
addr1 = translate oid1
addr2 = translate oid2
addr3 = translate oid3 load from addr3
leaving to programmers
pools with names at the beginning of the program -> eliminates performance overhead
addr1 = translate oid1
addr2 = translate oid2
addr3 = translate oid3 load from addr3 check-and-map “pool 1” check-and-map “pool 2” …
leaving to programmers
pools with names at the beginning of the program -> eliminates performance overhead
pools to open
addr1 = translate oid1
addr2 = translate oid2
addr3 = translate oid3 load from addr3 check-and-map “pool 1” check-and-map “pool 2” …
12
12
12
12
12
12
13
14
translations
14
translations
14
translations
POLB, similar to TLB
14
translations
POLB, similar to TLB
(SPOT) ★One SPOT in whole system, because pool ID is unique
14
translations
POLB, similar to TLB
(SPOT) ★One SPOT in whole system, because pool ID is unique ★Holds translation information of all pools (physical addresses)
14
translations
POLB, similar to TLB
(SPOT) ★One SPOT in whole system, because pool ID is unique ★Holds translation information of all pools (physical addresses) ★Holds permissions of all pools (UNIX file permissions)
14
searched in POLB
NVLD
Pool ID Offset
Core Permanent Storage
Persistent Object Look-aside Buffer (POLB) System Persistent Object Table (POT)
15
searched in POLB
unmapped in current process
NVLD
Pool ID Offset
Miss
Core
SPOT
Permanent Storage
POLB
15
searched in POLB
unmapped in current process
NVLD
Pool ID Offset
Miss
Core
SPOT
Permanent Storage
SPOT Walk POLB
15
Pool ID
Pool ID
Permission
searched in POLB
unmapped in current process
NVLD
Pool ID Offset
Miss
Core
SPOT
Permanent Storage
SPOT Walk POLB
Check permission
15
Pool ID
Pool ID
Permission
searched in POLB
unmapped in current process
physical address to POLB (no need for context switch)
NVLD
Pool ID Offset
Miss
Core
SPOT
Permanent Storage
SPOT Walk Update POLB POLB
Consider the pool is mapped
15
Pool ID
Pool ID
Permission
searched in POLB
unmapped in current process
physical address to POLB (no need for context switch)
NVLD
Pool ID Offset
Send Translated Address to Access Memory
Miss
Core
+
SPOT
Permanent Storage
SPOT Walk Update POLB POLB
15
Pool ID
Pool ID
Permission
entries with permission info
and group of the pool, along with the Owner Permission (OP), Group Permission (GP), and other permission (P).
registers of the running program Running user ID Primary* group ID
OP GP P
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info Protected register(s) * Considering a user might belong to multiple groups, select one of the group
16
Running user ID
OP GP P
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
Owner ID
17
Running user ID
OP GP P
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
Owner ID match?
17
OP
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
User and owner matched
OP GP P 18
OP
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
User and owner matched
OP GP P
= 00 ? Yes No permission, abort program
18
OP
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
User and owner matched
OP GP P
= 00 ? Yes No permission, abort program No = 1x ? Allow write Read-only = 01 ?
18
OP GP P
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
Group ID Primary group ID
19
OP GP P
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
match? Group ID Primary group ID
19
OP GP
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
Primary group ID and Group ID matched
GP P 20
OP GP
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
Primary group ID and Group ID matched
GP P 20
OP GP
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
Primary group ID and Group ID matched = 00 ? Yes Trap to OS*
GP P
*Because the user and the owner might belong to other groups.
20
OP GP
1 3 5 7 12 52 63
Group ID
64 127
Owner ID
96 SPOT Entry with permission info
Primary group ID and Group ID matched = 00 ? Yes Trap to OS* No = 1x ? Allow write Read-only = 01 ?
GP P
*Because the user and the owner might belong to other groups.
20
21
22
Three pool usage patterns for each microbenchmark:
different pool (1000~10000 pools)
randomly scattered in 32 pools
ALL EACH RANDOM * Each color represent one pool Benchmarks: Linked List, Red-Black Tree, B-Tree, B+ Tree, Binary Search Tree, String Position Swap and TPC-C and vacation
23
24
Translation Scheme Permission Check Mapping SwT-Base Software translation Separate check before translation Trap to OS SwT-Opt Software translation Check permission during translation Trap to OS HwT Hardware translation Separate check before translation Trap to OS HwT+SPOT Hardware translation Check permission during translation Hardware
24
Translation Scheme Permission Check Mapping SwT-Base Software translation Separate check before translation Trap to OS SwT-Opt Software translation Check permission during translation Trap to OS HwT Hardware translation Separate check before translation Trap to OS HwT+SPOT Hardware translation Check permission during translation Hardware
24
Translation Scheme Permission Check Mapping SwT-Base Software translation Separate check before translation Trap to OS SwT-Opt Software translation Check permission during translation Trap to OS HwT Hardware translation Separate check before translation Trap to OS HwT+SPOT Hardware translation Check permission during translation Hardware
24
Translation Scheme Permission Check Mapping SwT-Base Software translation Separate check before translation Trap to OS SwT-Opt Software translation Check permission during translation Trap to OS HwT Hardware translation Separate check before translation Trap to OS HwT+SPOT Hardware translation Check permission during translation Hardware
24
Translation Scheme Permission Check Mapping SwT-Base Software translation Separate check before translation Trap to OS SwT-Opt Software translation Check permission during translation Trap to OS HwT Hardware translation Separate check before translation Trap to OS HwT+SPOT Hardware translation Check permission during translation Hardware
24
Translation Scheme Permission Check Mapping SwT-Base Software translation Separate check before translation Trap to OS SwT-Opt Software translation Check permission during translation Trap to OS HwT Hardware translation Separate check before translation Trap to OS HwT+SPOT Hardware translation Check permission during translation Hardware
Normalized to SwT-Base
0.5 1 1.5 2 2.5 3 B e n c h ( A L L ) B e n c h ( E A C H ) B e n c h ( R A N D O M )
SwT-Opt HwT HwT+SPOT
25
* Normalized to SwT-Base
Normalized to SwT-Base
0.5 1 1.5 2 2.5 3 B e n c h ( A L L ) B e n c h ( E A C H ) B e n c h ( R A N D O M )
SwT-Opt HwT HwT+SPOT
25
* Normalized to SwT-Base
Normalized to SwT-Base
0.5 1 1.5 2 2.5 3 B e n c h ( A L L ) B e n c h ( E A C H ) B e n c h ( R A N D O M )
SwT-Opt HwT HwT+SPOT
25
* Normalized to SwT-Base
Normalized to SwT-Base
0.5 1 1.5 2 2.5 3 B e n c h ( A L L ) B e n c h ( E A C H ) B e n c h ( R A N D O M )
SwT-Opt HwT HwT+SPOT
25
* Normalized to SwT-Base
26
27