department of computer sciences, university of wisconsin madison dada dynamic allocation of disk...

61
Department of Computer Sciences, University of Wisconsin Madison DADA – Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Upload: jodie-tate

Post on 18-Jan-2018

215 views

Category:

Documents


0 download

DESCRIPTION

Department of Computer Sciences, University of Wisconsin Madison Problem Disk Volumes Allocate physical space on creation Multiple Disk Volumes on a physical disk Unused space Disk space not a premium What If?

TRANSCRIPT

Page 1: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

DADA – Dynamic Allocation of Disk Area

Jayaram BobbaVivek Shrivastava

Page 2: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

OutlineIntroduction Existing Framework Implementation Issues Results Conclusions

Page 3: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Problem

Disk Volumes Allocate physical space on creation

Multiple Disk Volumes on a physical disk Unused space Disk space not a premium What If?

Page 4: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Motivation Virtual Machine Environment

Add Some points

Storage Area Networks Storage area is the bo

Dynamic Physical Allocation (LFS style)

Page 5: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Related Work HP AutoRAID

Dynamically change redundancy levels Hot Data – Mirrored Cold Data – RAID 5 Dynamic migration of data

Page 6: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Outline IntroductionExisting Framework Implementation Issues Results Conclusions

Page 7: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Existing Framework Logical Volume Manager (LVM)

User space tool that enables creation of logical volumes of a logical partition.

Supports resizing of volumes. Device Mapper (DM)

Kernel driver that provides a level of indirection in address translation

Page 8: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

LVM design Volume Group (VG) Physical Volume (PV) Logical Volume (LV) Physical Extent (PE) Logical Extent (LE)

Page 9: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

LVM design

Physical Device

Page 10: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

LVM design

PV

PE

Page 11: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

LVM design

PV

PE

Page 12: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

LVM design

PV

LV 1

PE

Page 13: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

LVM design

PV

LE

LV 1LV2

PE

Page 14: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

LVM design

PV

LE

LV 1LV2

PE

Page 15: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

LVM designVG

PV

LE

LV 1LV2

PE

Page 16: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

DM designUserspace Applications

log kcopyd

emc

ioctl interface filesystem interface

control interface block interface

core device-mappermapping/target interface

linear striped snapshot multipath

round-robin

path selectors

hardwarehandlers

Page 17: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

LVM – DM interaction

Kernel

Userspace

Device Mapper

libdevmapper

LVM2

Page 18: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Outline Introduction Existing FrameworkImplementation Issues Results Conclusions

Page 19: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Modifications A trap mechanism from kernel driver to user-

level LVM code.

Support for multiple segments in LV

Support for virtual mappings in driver

Page 20: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Initial State

LVM

Device Mapper

User space

Kernel space

Unallocated Disk Space

LVM daemon

Page 21: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Volume Group Creation

LVM

Device Mapper

User space

Kernel space

Unallocated Disk Space

LVM daemon

PE (4MB) 25 Extents

Page 22: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon Create LV

32MB

User A

Page 23: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon

User A

Map 0-7 extents for user A

Page 24: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon

User A

Map 0-7 extents for user A

Page 25: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

Create LV

16 MB

Page 26: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

Create LV

16 MB

map 8-11 extents for B

Page 27: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

map 8-11 extents for B

Page 28: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User BRead/write

Read/write

Page 29: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Volume Group Creation

LVM

Device Mapper

User space

Kernel space

Unallocated Disk Space

LVM daemon

PE (4MB) 25 Extents

Page 30: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon Create LV1

32MB

User A

Page 31: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon

User A

Virtually map 0-7 extents for user A

{0-7 error}

Page 32: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

Create LV

16 MB

{0-7 error}

Page 33: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

Create LV2

16 MB

Virtually map 8-11 extents for B

{0-7 error} {8-11 error}

Page 34: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

{0-7 error} {8-11 error}

Write 6MB

Page 35: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

{0-7 error} {8-11 error}

writetrap

Page 36: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

{0-7 error} {8-11 error}

writetrap

On Demand allocation of disk

area

Page 37: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space Kernel space

Free Disk Space

LVM daemon User A

User B

{0-7 error} {8-11 error}

Write 6MB

trap

On Demand allocation of disk

area

Allocate 2 extents (8MB)

Page 38: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space Kernel space

Free Disk Space

LVM daemon User A

User B

{0-1 linear}{2-7 error}

{8-11 error}

Write 6MB

trap

On Demand allocation of disk

area

Allocate 2 extents (8MB)

Page 39: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space Kernel space

Free Disk Space

LVM daemon User A

User B

{0-1 linear}{2-7 error}{8-11 error}

Write

10MB

Page 40: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

(0-1 linear}{0-7 error}{8-11 error}

Write 10 MB trap

Page 41: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space

Kernel space

Free Disk Space

LVM daemon User A

User B

{0-7 error} {8-11 error}

writetrap

On Demand allocation of disk

area

Page 42: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Current Implementation

LVM

Device Mapper

User space Kernel space

Free Disk Space

LVM daemon User A

User B

{0-1 linear}{2-7 error}{8-10 linear}

Write 10 MBtrap

On Demand allocation of disk

area

Allocate 3 extents (12 MB)

{11 error}

Page 43: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Outline Introduction Existing Framework ImplementationIssues Results Conclusions

Page 44: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Issues Not the most efficient implementation On a trap,

How much to allocate? On demand Pre-allocate

Where to allocate? Temporal locality Spatial locality

Free unused space

Page 45: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

How much? On-demand

Allocate only as many blocks as needed Pre-allocate

Pre-allocate physical space for blocks likelyto be accessed in the future.

How much? Where?

Page 46: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

How much? Tradeoff – Performance vs. Disk Space Depends on the workload

I/O on critical path Asynchronous I/O Multithreaded Applications

Page 47: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Pre-Allocation

Think: Filesystem Block Allocation Dumb Allocation

Stride Allocation

Multi-Strided Allocation

Page 48: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Dumb Allocation

LVM

Device Mapper

User space Kernel space

Free Disk Space

LVM daemon User A

{0-1 linear}{2-7 error}

Write 6MB

trap

On Demand allocation of disk

area

Allocate 2 extents (8MB)

Page 49: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Stride Allocation

LVM

Device Mapper

User space Kernel space

Free Disk Space

LVM daemon User A

{0-1 linear}{2-7 error}

Write 6MB

trap

On Demand allocation of disk

area

Allocate 4 extents (16MB)

PreAllocated Extent

Page 50: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Ext2 access pattern

Page 51: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Ext3 access pattern

Page 52: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Outline Introduction Existing Framework Implementation IssuesResults Conclusions

Page 53: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Results Micro Benchmarks

mkfs Trace based analysis

Trace collected by HP Research Lab

Page 54: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Micro Benchmark : mkfs

ExecutionTimes

0

20

40

60

80

100

120

140

8K 16K 32K 64K 128K 256K 512K 1M 2M 4M

Extent Size

Tim

e Ta

ken(

in s

ecs)

#Traps Taken

0

50

100

150

200

250

300

350

400

450

8K 16K 32K 64K 128K 256K 512K 1M 2M 4M

Extent Size

# Tr

aps

Take

n

Page 55: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Micro Benchmark : Asynchronous I/O

Page 56: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Micro Benchmark : Asynchronous I/O

Page 57: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Trace Based Analysis

Page 58: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Trace Based Analysis

Page 59: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Outline Introduction Existing Framework Implementation Issues ResultsConclusions

Page 60: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Conclusions Tradeoff between performance penalty and

space Useful in environments where space is the

bottleneck resource Techniques like Pre Allocation reduce the

performance penalty to some extent For practical implementation, LVM must be

placed in kernel address space

Page 61: Department of Computer Sciences, University of Wisconsin Madison DADA  Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava

Department of Computer Sciences, University of Wisconsin Madison

Conclusions mkfs performance degrades substantially due

to traps. No degradation in performance for CPU

intensive applications with asynchronous I/O Extent size in the range of 512K-1M provide

best results for the trace This evaluation will be more realistic, if LVM

is moved into Kernel Address space.