660 likes | 804 Views
DADA – Dynamic Allocation of Disk Area. Jayaram Bobba Vivek Shrivastava. Outline. Introduction Existing Framework Implementation Issues Results Conclusions. Problem. Disk Volumes Allocate physical space on creation Multiple Disk Volumes on a physical disk Unused space
E N D
DADA – Dynamic Allocation of Disk Area Jayaram Bobba Vivek Shrivastava Department of Computer Sciences, University of Wisconsin Madison
Outline • Introduction • Existing Framework • Implementation • Issues • Results • Conclusions 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? Department of Computer Sciences, University of Wisconsin Madison
Motivation • Virtual Machine Environment • Multiple OS may create pressure on disk space • Access patterns may warrant dynamic relocation of disk blocks • Storage Area Networks • Storage area is a bottleneck resource • Dynamic Physical Allocation (LFS style) • Group writes from various volumes into a single physical write. 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 Department of Computer Sciences, University of Wisconsin Madison
Outline • Introduction • Existing Framework • Implementation • Issues • Results • Conclusions 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 Department of Computer Sciences, University of Wisconsin Madison
LVM design • Physical Volume (PV) • Volume Group (VG) • Logical Volume (LV) • Physical Extent (PE) • Logical Extent (LE) Department of Computer Sciences, University of Wisconsin Madison
LVM design Physical Device Department of Computer Sciences, University of Wisconsin Madison
LVM design PV PE Department of Computer Sciences, University of Wisconsin Madison
LVM design LV 1 PV PE Department of Computer Sciences, University of Wisconsin Madison
LVM design LE LV 1 LV2 PV PE Department of Computer Sciences, University of Wisconsin Madison
LVM design LE LV 1 LV2 PV PE Department of Computer Sciences, University of Wisconsin Madison
LVM design LE VG LV 1 LV2 PV PE Department of Computer Sciences, University of Wisconsin Madison
LVM – DM interaction LVM2 libdevmapper Userspace Kernel Device Mapper Department of Computer Sciences, University of Wisconsin Madison
Outline • Introduction • Existing Framework • Implementation • Issues • Results • Conclusions 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 Department of Computer Sciences, University of Wisconsin Madison
Initial State LVM daemon LVM User space Kernel space Device Mapper Unallocated Disk Space Department of Computer Sciences, University of Wisconsin Madison
Volume Group Creation LVM daemon LVM User space Kernel space Device Mapper PE (4MB) 25 Extents Unallocated Disk Space Department of Computer Sciences, University of Wisconsin Madison
Current Implementation LVM daemon Create LV 32MB User A LVM User space Kernel space Device Mapper Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Current Implementation LVM daemon User A LVM Map 0-7 extents for user A User space Kernel space Device Mapper Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Current Implementation LVM daemon User A LVM Map 0-7 extents for user A User space Kernel space Device Mapper Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Current Implementation LVM daemon User A LVM Create LV User B 16 MB User space Kernel space Device Mapper Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Current Implementation LVM daemon User A LVM Create LV User B 16 MB map 8-11 extents for B User space Kernel space Device Mapper Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Current Implementation LVM daemon User A LVM User B map 8-11 extents for B User space Kernel space Device Mapper Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Current Implementation LVM daemon User A LVM User B Read/write User space Read/write Kernel space Device Mapper Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Volume Group Creation LVM daemon LVM User space Kernel space Device Mapper PE (4MB) 25 Extents Unallocated Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation LVM daemon Create LV1 32MB User A LVM User space Kernel space Device Mapper Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation LVM daemon User A LVM Virtually map 0-7 extents for user A User space Kernel space Device Mapper {0-7 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation LVM daemon User A LVM Create LV User B 16 MB User space Kernel space Device Mapper {LV A 0-7 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation LVM daemon User A LVM Create LV2 User B 16 MB Virtually map 0-3 extents for B User space Kernel space Device Mapper {LV A 0-7 error} {LV B 0-3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation LVM daemon User A LVM Write 6MB User B User space Kernel space Device Mapper {LV A 0-7 error} {LV B 0-3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation LVM daemon User A LVM Write 6MB User B trap User space Kernel space Device Mapper {LV A 0-7 error} {LV B 0-3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation On Demand allocation of disk area LVM daemon User A LVM Write 6MB User B trap User space Kernel space Device Mapper {LV A 0-7 error} {LV B 0-3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation On Demand allocation of disk area LVM daemon User A LVM Write 6MB User B Allocate 0-1 extents (8MB) LV A User space Kernel space Device Mapper {LV A 0-7 error} {LV B 0-3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation On Demand allocation of disk area LVM daemon User A LVM Write 6MB User B Return User space Kernel space Device Mapper {LV A 0-1 linear,2-7 error} {LV B 0-3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation LVM daemon User A LVM User B Write 10MB User space Kernel space Device Mapper {LV A 0-1 linear,2-7 error} {LV B 0-3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation LVM daemon User A LVM User B Write 10 MB trap User space Kernel space Device Mapper {LV A 0-1 linear,2-7 error} {LV B 0-3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation On Demand allocation of disk area LVM daemon User A LVM User B Write 10 MB trap User space Kernel space Device Mapper {LV A 0-1 linear,2-7 error} {LV B 0-3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Modified Implementation On Demand allocation of disk area LVM daemon User A LVM User B LV B Allocate 8-11 extents (12 MB) Write 10 MB User space Kernel space Device Mapper {LV A 0-1 linear,2-7 error} {LV B 0-2 linear, 3 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Outline • Introduction • Existing Framework • Implementation • Issues • Results • Conclusions Department of Computer Sciences, University of Wisconsin Madison
Issues LVM implementation not efficient LVM2 libdevmapper Userspace Kernel Device Mapper Department of Computer Sciences, University of Wisconsin Madison
Issues LVM implementation not efficient LVM2 Costly kernel-user space crossing libdevmapper Userspace Kernel Device Mapper Department of Computer Sciences, University of Wisconsin Madison
Issues LVM implementation not efficient LVM2 Normal function call libdevmapper Userspace Device Mapper Kernel Department of Computer Sciences, University of Wisconsin Madison
More Issues • On a trap • How much to allocate? • On demand • Pre-allocate • Where to allocate? • Temporal locality • Spatial locality • Free unused space 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 likely to be accessed in the future. • How much? • Where? 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 Department of Computer Sciences, University of Wisconsin Madison
Pre-Allocation Think: Filesystem Block Allocation • Dumb Allocation • Stride Allocation • Multi-Strided Allocation Department of Computer Sciences, University of Wisconsin Madison
Allocation Strategy On Demand allocation of disk area LVM daemon User A LVM Write Allocate 2 extents (8MB) trap User space Kernel space Device Mapper {0-1 linear}{2-7 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison
Allocation Strategy On Demand allocation of disk area LVM daemon User A LVM Write Allocate 2 extents (8MB) trap User space Kernel space Device Mapper {0-1 linear}{2-7 error} Free Disk Space Department of Computer Sciences, University of Wisconsin Madison