linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH LVM2] (0/3) 'cling' allocation policy
@ 2006-10-06 21:54 Jun'ichi Nomura
  2006-10-06 21:55 ` [linux-lvm] [PATCH LVM2] (1/3) remove unnecessary parameter from _check_contiguous Jun'ichi Nomura
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jun'ichi Nomura @ 2006-10-06 21:54 UTC (permalink / raw)
  To: linux-lvm, Alasdair Kergon

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

Hi,

These series of patches implement 'cling' allocation policy.
Patches are applicable to LVM2 2.02.10.

In current implementation, 'normal' policy allows the allocation
like this (output of lvs -a -o+devices):
  LV             Devices
  lv0            lv0_mimage_0(0),lv0_mimage_1(0)
  [lv0_mimage_0] /dev/sdb(0)
  [lv0_mimage_0] /dev/sda(2)
  [lv0_mimage_1] /dev/sda(0)
  [lv0_mimage_1] /dev/sdb(2)
  [lv0_mlog]     /dev/sdc(0)
  dummy1         /dev/sda(1)
  dummy2         /dev/sdb(1)
  dummy3         /dev/sdc(1)

You see /dev/sda is used for both lv0_mimage_0 and lv0_mimage_1.
If this disk breaks, you lose the whole LV.

In this case, what I think is better is something like this:
  LV             Devices
  lv0            lv0_mimage_0(0),lv0_mimage_1(0)
  [lv0_mimage_0] /dev/sdb(0)
  [lv0_mimage_0] /dev/sdb(2)
  [lv0_mimage_1] /dev/sda(0)
  [lv0_mimage_1] /dev/sda(2)
  [lv0_mlog]     /dev/sdc(0)
  dummy1         /dev/sda(1)
  dummy2         /dev/sdb(1)
  dummy3         /dev/sdc(1)

With these patches, 'normal' allocation tries to do the latter first.

Attached is a VG metadata as a testcase.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America

[-- Attachment #2: testvg0_alloc-cling.vg --]
[-- Type: text/plain, Size: 3171 bytes --]

# Generated by LVM2: Sat Oct  7 01:56:23 2006

contents = "Text Format Volume Group"
version = 1

description = "Created *before* executing 'lvextend -l+1 testvg0/lv0'"

creation_host = "tetsuo.lab"	# Linux tetsuo.lab 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686
creation_time = 1160200583	# Sat Oct  7 01:56:23 2006

testvg0 {
	id = "1q8uy1-HgpO-JpQK-Dvn4-SYlQ-r452-YQa0P0"
	seqno = 7
	status = ["RESIZEABLE", "READ", "WRITE"]
	extent_size = 8192		# 4 Megabytes
	max_lv = 0
	max_pv = 0

	physical_volumes {

		pv0 {
			id = "EkAheU-E42S-nhmb-h3LB-CGEG-4NvX-f0PbFP"
			device = "/dev/dm-0"	# Hint only

			status = ["ALLOCATABLE"]
			pe_start = 384
			pe_count = 4	# 16 Megabytes
		}

		pv1 {
			id = "Ee7qjC-qtNm-TBd4-ql19-aRZg-mCXk-CCs5Uk"
			device = "/dev/dm-1"	# Hint only

			status = ["ALLOCATABLE"]
			pe_start = 384
			pe_count = 4	# 16 Megabytes
		}

		pv2 {
			id = "3wvgkO-7p1Z-yoHy-stW4-ZY3p-VHg1-DQe9d7"
			device = "/dev/dm-2"	# Hint only

			status = ["ALLOCATABLE"]
			pe_start = 384
			pe_count = 4	# 16 Megabytes
		}
	}

	logical_volumes {

		lv0 {
			id = "RIWMkB-slcN-4ZtA-iVrd-HIZO-PEO2-Z3ommp"
			status = ["READ", "WRITE", "VISIBLE"]
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 1	# 4 Megabytes

				type = "mirror"
				mirror_count = 2
				mirror_log = "lv0_mlog"
				region_size = 1024

				mirrors = [
					"lv0_mimage_0", 0,
					"lv0_mimage_1", 0
				]
			}
		}

		dummy1 {
			id = "TlfCSG-kzkN-fv65-xd5g-Hpb0-I3dG-k7UVAJ"
			status = ["READ", "WRITE", "VISIBLE"]
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 1	# 4 Megabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv0", 1
				]
			}
		}

		dummy2 {
			id = "hWyYcp-FD0J-JiFy-dziI-g0FZ-Begs-aYEbJ2"
			status = ["READ", "WRITE", "VISIBLE"]
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 1	# 4 Megabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv1", 1
				]
			}
		}

		dummy3 {
			id = "NhIJ26-07w0-OA6d-ZE14-gegx-nVW8-YRM5vq"
			status = ["READ", "WRITE", "VISIBLE"]
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 1	# 4 Megabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv2", 1
				]
			}
		}

		lv0_mlog {
			id = "OP7pVI-Col0-vKbT-Zwar-M7CC-dZiP-WkV740"
			status = ["READ", "WRITE"]
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 1	# 4 Megabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv2", 0
				]
			}
		}

		lv0_mimage_0 {
			id = "2TWuNa-37S2-1m4O-SC02-uDEq-5l1O-AT3CcI"
			status = ["READ", "WRITE"]
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 1	# 4 Megabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv1", 0
				]
			}
		}

		lv0_mimage_1 {
			id = "S2EKHn-CroW-aFS7-ptF5-mYUo-DuYt-NmT1YD"
			status = ["READ", "WRITE"]
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 1	# 4 Megabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv0", 0
				]
			}
		}
	}
}

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-10-09 16:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-06 21:54 [linux-lvm] [PATCH LVM2] (0/3) 'cling' allocation policy Jun'ichi Nomura
2006-10-06 21:55 ` [linux-lvm] [PATCH LVM2] (1/3) remove unnecessary parameter from _check_contiguous Jun'ichi Nomura
2006-10-06 21:56 ` [linux-lvm] [PATCH LVM2] (2/3) use _for_each_pv() from _check_contiguous() Jun'ichi Nomura
2006-10-07 23:38   ` [linux-lvm] " Alasdair G Kergon
2006-10-09 16:27     ` Jun'ichi Nomura
2006-10-06 21:56 ` [linux-lvm] [PATCH LVM2] (3/3) add 'cling' allocation policy Jun'ichi Nomura
2006-10-08 12:06   ` [linux-lvm] " Alasdair G Kergon
2006-10-07 10:51 ` [linux-lvm] Re: [PATCH LVM2] (0/3) " Alasdair G Kergon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).