public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW lib/config/defaults.h tools/l ... Date: Mon, 05 Mar 2012 14:19:00 -0000 [thread overview] Message-ID: <20120305141915.15507.qmail@sourceware.org> (raw) 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.");
next reply other threads:[~2012-03-05 14:19 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-03-05 14:19 zkabelac [this message] -- strict thread matches above, loose matches on Subject: below -- 2009-11-27 14:35 mbroz
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20120305141915.15507.qmail@sourceware.org \ --to=zkabelac@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).