public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/config/defaults.h tools/l ...
@ 2009-11-27 14:35 mbroz
  0 siblings, 0 replies; 2+ messages in thread
From: mbroz @ 2009-11-27 14:35 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-11-27 14:35:39

Modified files:
	.              : WHATS_NEW 
	lib/config     : defaults.h 
	tools          : lvconvert.c lvcreate.c 

Log message:
	Do not allow creating mirrors of more than 8 images.
	
	This is kernel limitation in all kernel versions,
	so better detect this early.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1334&r2=1.1335
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/defaults.h.diff?cvsroot=lvm2&r1=1.53&r2=1.54
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.97&r2=1.98
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.210&r2=1.211

--- LVM2/WHATS_NEW	2009/11/27 14:32:16	1.1334
+++ LVM2/WHATS_NEW	2009/11/27 14:35:38	1.1335
@@ -1,5 +1,6 @@
 Version 2.02.57 -
 ====================================
+  Do not allow creating mirrors of more than 8 images.
   Use locking_type 3 (compiled in cluster locking) in lvmconf.
   Remove duplicate dm_list macros and functions.
   Log failure type and recognise type 'F' (flush) in dmeventd mirror plugin.
--- LVM2/lib/config/defaults.h	2009/10/05 12:44:21	1.53
+++ LVM2/lib/config/defaults.h	2009/11/27 14:35:39	1.54
@@ -47,6 +47,7 @@
 #define DEFAULT_MIRRORLOG "disk"
 #define DEFAULT_MIRROR_LOG_FAULT_POLICY "allocate"
 #define DEFAULT_MIRROR_DEV_FAULT_POLICY "remove"
+#define DEFAULT_MIRROR_MAX_IMAGES 8 /* limited by kernel DM_KCOPYD_MAX_REGIONS */
 #define DEFAULT_DMEVENTD_MIRROR_LIB "libdevmapper-event-lvm2mirror.so"
 #define DEFAULT_DMEVENTD_MONITOR 1
 
--- LVM2/tools/lvconvert.c	2009/11/03 15:50:44	1.97
+++ LVM2/tools/lvconvert.c	2009/11/27 14:35:39	1.98
@@ -571,6 +571,12 @@
 	else
 		lp->mirrors += 1;
 
+	if (lp->mirrors > DEFAULT_MIRROR_MAX_IMAGES) {
+		log_error("Only up to %d images in mirror supported currently.",
+			  DEFAULT_MIRROR_MAX_IMAGES);
+		return 0;
+	}
+
 	if (repair) {
 		cmd->handles_missing_pvs = 1;
 		cmd->partial_activation = 1;
--- LVM2/tools/lvcreate.c	2009/11/04 14:47:28	1.210
+++ LVM2/tools/lvcreate.c	2009/11/27 14:35:39	1.211
@@ -500,6 +500,12 @@
 		return 0;
 	}
 
+	if (lp->mirrors > DEFAULT_MIRROR_MAX_IMAGES) {
+		log_error("Only up to %d images in mirror supported currently.",
+			  DEFAULT_MIRROR_MAX_IMAGES);
+		return 0;
+	}
+
 	/*
 	 * Read ahead.
 	 */


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

* LVM2 ./WHATS_NEW lib/config/defaults.h tools/l ...
@ 2012-03-05 14:19 zkabelac
  0 siblings, 0 replies; 2+ messages in thread
From: zkabelac @ 2012-03-05 14:19 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-05 14:19:14

Modified files:
	.              : WHATS_NEW 
	lib/config     : defaults.h 
	tools          : lvcreate.c 

Log message:
	Fit thin pool metadata into 128MB
	
	If the lvcreate may decide some automagical values for a user,
	try to keep the pool metadata size into 128MB range for optimal
	perfomance (as suggested by Joe).
	
	So if the pool metadata size and chunk_size were not specified,
	try to select such values they would fit into 128MB size.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2343&r2=1.2344
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/defaults.h.diff?cvsroot=lvm2&r1=1.97&r2=1.98
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.260&r2=1.261

--- LVM2/WHATS_NEW	2012/03/05 14:15:50	1.2343
+++ LVM2/WHATS_NEW	2012/03/05 14:19:13	1.2344
@@ -1,5 +1,6 @@
 Version 2.02.95 -
 ================================
+  Try to fit thin pool metadata size into 128MB.
   Print just warning on thin pool check callback path for failing check.
   Use 64bit math for verification of thin pool and snapshot chunk size.
   Validate udev structures in _insert_udev_dir().
--- LVM2/lib/config/defaults.h	2012/03/02 21:49:44	1.97
+++ LVM2/lib/config/defaults.h	2012/03/05 14:19:14	1.98
@@ -68,6 +68,7 @@
 #define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
 #define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (16 * 1024 * 1024)  /* KB */
 #define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048  /* KB */
+#define DEFAULT_THIN_POOL_OPTIMAL_SIZE     (128 * 1024 * 1024)	/* KB */
 
 #define DEFAULT_UMASK 0077
 
--- LVM2/tools/lvcreate.c	2012/03/02 20:18:25	1.260
+++ LVM2/tools/lvcreate.c	2012/03/05 14:19:14	1.261
@@ -235,6 +235,7 @@
 {
 	uint32_t pv_extent_count;
 	struct logical_volume *origin = NULL;
+	int changed = 0;
 
 	if (lcp->size &&
 	    !(lp->extents = extents_from_size(vg->cmd, lcp->size,
@@ -294,11 +295,26 @@
 	}
 
 	if (lp->create_thin_pool) {
-		if (!arg_count(vg->cmd, poolmetadatasize_ARG))
+		if (!arg_count(vg->cmd, poolmetadatasize_ARG)) {
 			/* Defaults to nr_pool_blocks * 64b */
 			lp->poolmetadatasize =  (uint64_t) lp->extents * vg->extent_size /
 				(uint64_t) (lp->chunk_size * (SECTOR_SIZE / UINT64_C(64)));
 
+			/* Check if we could eventually use bigger chunk size */
+			if (!arg_count(vg->cmd, chunksize_ARG)) {
+				while ((lp->poolmetadatasize >
+					(DEFAULT_THIN_POOL_OPTIMAL_SIZE / SECTOR_SIZE)) &&
+				       (lp->chunk_size < DM_THIN_MAX_DATA_BLOCK_SIZE)) {
+					lp->chunk_size <<= 1;
+					lp->poolmetadatasize >>= 1;
+					changed++;
+				}
+				if (changed)
+					log_verbose("Changed chunksize to %u sectors.",
+						    lp->chunk_size);
+			}
+		}
+
 		if (lp->poolmetadatasize > (2 * DEFAULT_THIN_POOL_MAX_METADATA_SIZE)) {
 			if (arg_count(vg->cmd, poolmetadatasize_ARG))
 				log_warn("WARNING: Maximum supported pool metadata size is 16GB.");


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

end of thread, other threads:[~2012-03-05 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-27 14:35 LVM2 ./WHATS_NEW lib/config/defaults.h tools/l mbroz
2012-03-05 14:19 zkabelac

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 read-only IMAP folder(s) and NNTP newsgroup(s).