summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* dmsetup: use timerfd for interval timing if availabledev-bmr-dmstats-timerfdBryn M. Reeves2015-08-124-42/+290
| | | | | | | | | | | If the Linux timerfd interface to POSIX timers is available at compile time use it for all report interval timekeeping. This gives more accurate interval timing when the per-interval processing time is less than the configured interval and simplifies the timestamp bookkeeping required to keep accurate time. For systems without timerfd support fall back to the simple usleep based timer.
* libdm: add dm_timestamp_copy()Bryn M. Reeves2015-08-123-0/+11
|
* tests: keep testing mq policyZdenek Kabelac2015-08-123-0/+5
| | | | Tests were written for 'mq' policy, so disable smq.
* tests: link some new cache profilesZdenek Kabelac2015-08-121-1/+2
|
* cleanup: indentZdenek Kabelac2015-08-123-5/+4
|
* cleanup: use IEC KiB unitsZdenek Kabelac2015-08-121-18/+18
| | | | Reduce mixing of KB, kiB and use just KiB.
* libdm: rename to data_block_sizeZdenek Kabelac2015-08-122-7/+7
| | | | | | | Use common name for pool device - as we use data_block_size for thin pool metadata, use same name for cache_pool. This change does not affect API.
* libdm: cache target arg validationZdenek Kabelac2015-08-122-0/+27
| | | | Add some arg validation for dm_tree_node_add_cache_target().
* config: extend definition for AllocationZdenek Kabelac2015-08-121-1/+2
| | | | Extend comment for this section.
* config: support longer config pathsZdenek Kabelac2015-08-121-1/+1
| | | | 64 bytes might not be enough, so use larger buffer size.
* cache: add more validationZdenek Kabelac2015-08-124-2/+24
|
* cache: api updateZdenek Kabelac2015-08-129-70/+165
| | | | | | | | | | | | | | Change logic and naming of some internal API functions. cache_set_mode() and cache_set_policy() both take segment. cache mode is now correctly 'masked-in'. If the passed segment is 'cache' segment - it will automatically try to find 'defaults' according to profiles if the are NOT specified on command line or they are NOT already set for cache-pool. These defaults are never set for cache-pool.
* cache: undefined policy is mqZdenek Kabelac2015-08-121-1/+3
| | | | | If the policy_name is unspecified in metadata, it's automatically 'mq'.
* toollib: get_cache_paramsZdenek Kabelac2015-08-127-44/+36
| | | | Enhance get_cache_params() to read common cache args.
* cache: man updatesZdenek Kabelac2015-08-122-10/+31
| | | | Better man for cachepolicy and cachesettings.
* cache: runtime detect default policyZdenek Kabelac2015-08-122-1/+22
| | | | | | When the policy is not preset in lvm.conf, detect in runtime whether to use 'mq' or new available 'smq'.
* cache: detect smq policy presenceZdenek Kabelac2015-08-123-3/+81
| | | | | | | Add code to detect available cache features. Support policy_mq & policy_smq features which might be disabled. Introduce global_cache_disabled_features_CFG.
* cache: introduce mq and smq profilesZdenek Kabelac2015-08-124-2/+41
| | | | | | | Add 2 demo profiles for mq and smq policies. Show all support profilable params. Use with: lvcreate --policy cache-mq ....
* cache: add cache_policy cache_settingsZdenek Kabelac2015-08-127-7/+33
| | | | | | | | | | | | | | Add new profilable configurables: allocation/cache_policy allocation/cache_settings and mark allocation/cache_pool_chunk_size as profilable as well. Obsolete allocation/cache_pool_cachemode and introduce new allocation/cache_mode instead. Rename DEFAULT_CACHE_POOL_POLICY to DEFAULT_CACHE_POLICY.
* configure: --clear-need-check-flag needs 0.5.4Zdenek Kabelac2015-08-123-18/+33
| | | | | Require version 5.4 of cache_check tool where this option will work correctly.
* udev: use += for SYSTEMD_WANTS instead of =Thomas Bächler2015-08-122-1/+2
| | | | | Instead of using = to override SYSTEMD_WANTS, use += to add the pvscan service.
* lvconvert: fix lockd LV lockingDavid Teigland2015-08-111-7/+5
| | | | | | | | | | | | Request a transient LV lock from lvmlockd when converting an LV. If the LV is inactive when lvconvert is run, the LV lock will be acquired and then released when the command is done. If the LV is active, a persistent lock exists already and the transient lock request does nothing. This fixes the issue that had been mentioned in the comment previously.
* lvrename: fix lockd LV lockingDavid Teigland2015-08-101-0/+12
| | | | | | lvrename should not be done if the LV is active on another host. This check was mistakenly removed when the code was changed to use LV uuids in locks rather than LV names.
* lvmlockd: add LV name to some debug loggingDavid Teigland2015-08-101-3/+10
| | | | | | The LV uuid is used as the lock name, and including the LV name in some log messages makes it easier to follow log messages.
* libdm-stats: backtrace if fclose fails (Coverity)Bryn M. Reeves2015-08-101-6/+14
| | | | | | | | | | | | | Since libdm-stats only uses fmemopen'd FILE objects the only way that a close can fail is corruption of the memory containing the FILE: check for this case and emit a backtrace if it occurs. libdm/libdm-stats.c: 338 in _stats_parse_list() libdm/libdm-stats.c: 341 in _stats_parse_list() libdm/libdm-stats.c: 481 in _stats_parse_region() libdm/libdm-stats.c: 487 in _stats_parse_region() libdm/libdm-stats.c: 487 in _stats_parse_region() - Calling "fclose" without checking return value
* libdm: simplify stats nr_areas calculation (Coverity)Bryn M. Reeves2015-08-101-2/+1
| | | | | | | Remove an unneccessary conditional operator and simplify the logic in _nr_areas: libdm/libdm-stats.c: 501 in _nr_areas() - Control flow issues (DEADCODE)
* dmsetup: don't free handle if dm_stats_create fails (Coverity)Bryn M. Reeves2015-08-101-1/+1
| | | | | | | The error path of _stats_list frees the task and stats objects: don't try to branch to it before they have been allocated. tools/dmsetup.c: 4589 in _stats_help() - Null pointer dereferences (FORWARD_NULL)
* libdm: fix stats handle leak in dm_stats_create (Coverity)Bryn M. Reeves2015-08-101-2/+5
| | | | | | | Make sure the newly created handle is freed if we are unable to also create the pool for it. tools/dmsetup.c: 4255 in _stats_list() - Variable "dms" going out of scope leaks the storage it points to.
* libdm: fix FILE leak in _program_id_from_proc() (Coverity)Bryn M. Reeves2015-08-101-4/+6
| | | | | | Make sure comm is closed in the error path of _program_id_from_proc(). libdm/libdm-stats.c: 98 in dm_stats_create() - Variable "comm" going out of scope leaks the storage it points to.
* dmsetup: remove bogus !_report test in _stats_report (Coverity)Bryn M. Reeves2015-08-101-3/+0
| | | | | | | | There's no point testing _report here in _stats_report: it's always initialised before the function is called and if the check did fail we'd end up freeing an uninitialized dm_task in the error path. tools/dmsetup.c: 4389 in _stats_report() - Declaring variable "dmt" without initializer.
* lvmlockd: fix check for other sanlock lockspacesDavid Teigland2015-08-101-0/+4
| | | | | | The check for other sanlock lockspaces was not checking that the lockspace type was sanlock, so if dlm lockspaces were visible, they were wrongly included.
* vgremove: fix locking when lvmlockd global lock is removedDavid Teigland2015-08-102-1/+28
| | | | | | | | When vgremove is used to remove multiple VGs in one command, e.g. vgremove foo bar, the first VG (foo) that is removed may have held the sanlock global lock. In this case, do not continue removing further VGs (bar) without the global lock.
* post-releaseAlasdair G Kergon2015-08-104-2/+8
|
* pre-releasev2_02_127Alasdair G Kergon2015-08-104-14/+19
|
* dmsetup: Also install dmstats.Alasdair G Kergon2015-08-102-0/+4
|
* dmstats: add libdm-stats library and 'dmsetup stats' commandBryn M. Reeves2015-08-098-37/+4388
| | | | | | | | | | | | | | | | | | | | Add the libdm-stats module to libdm: this implements a simple interface for creating, managing and interrogating I/O statistics regions and areas on device-mapper devices. The library interface is documented in libdevmapper.h and provides a 'dm_stats' handle that is used to perform statistics operations and obtain data. Public methods are provided to create and destroy handles and to list, create, and destroy statistics regions as well as to obtain and parse counter data and calculate rate-based metrics. This commit also adds a 'dmsetup stats' (aka 'dmstats') command with 'clear', 'create', 'delete', 'list', 'print', and 'report' sub-commands. See the library documentation and the dmstats.8 manual page for detailed API and command descriptions.
* WHATS_NEW_DM: Update for preliminary stats commitsBryn M. Reeves2015-08-081-1/+2
| | | | | Add entries for dm_report_column_headings() and report row leaks and remove the dm_report interval/wait entry.
* libdm: do not attempt to output column headings with --rowsBryn M. Reeves2015-08-081-0/+3
| | | | | Columns-as-rows output does not use _report_headings(); don't try to call it when rh->flags & DM_REPORT_OUTPUT_COLUMNS_AS_ROWS.
* libdm: remove report interval supportBryn M. Reeves2015-08-084-98/+42
| | | | | | | | Don't do interval management and external timekeeping for stats in dm_report: let applications handle this on their own. Since this has not been included in a release remove it from the library entirely and handle report timing directly inside dmsetup.
* libdm: add dm_report_column_headingsBryn M. Reeves2015-08-084-3/+16
| | | | | | | | | | | | Add a function to print column headings regardless of whether they have already been output. This will be used by dmstats to issue periodic reminders of the column headings. This patch removes a check for RH_HEADINGS_PRINTED from _report_headings that prevents headings being displayed if the flag is already set; this check is redundant since the only existing caller (_output_as_columns()) already tests the flag before calling the function.
* libdm: fix report rows and headings memory and state leaksBryn M. Reeves2015-08-081-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not releasing objects back to the pool is fine for short-lived pools since the memory will be freed when dm_pool_destroy() is called. Any pool that may be long-lived needs to be more careful to free objects back to the pool to avoid leaking memory that will not be reclaimed until the pool is destroyed at process exit time. The report pool currently leaks each headings line and some row data. Although dm_report_output() tries to free the first allocated row this may end up freeing a later row due to sorting of the row list while reporting. Store a pointer to the first allocated row from _do_report_obect() instead and free this at the end of _output_as_columns(), _output_as_rows(), and dm_report_clear(). Also make sure to call dm_pool_free() for the headings line built in _report_headings(). When dmstats is introduced it will maintain dm_report objects for the whole lifetime of the process: without these changes a stats report could leak around 600k in 10m (exact rate depends on field selection and data values): top - 12:11:32 up 4 days, 3:16, 15 users, load average: 0.01, 0.12, 0.14 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 6473 root 20 0 130196 3124 2792 S 0.0 0.0 0:00.00 dmstats top - 12:22:04 up 4 days, 3:26, 15 users, load average: 0.06, 0.11, 0.13 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 6498 root 20 0 130836 3712 2752 S 0.0 0.0 0:00.60 dmstats With this patch no increase in RSS is seen: top - 13:54:58 up 4 days, 4:59, 15 users, load average: 0.12, 0.14, 0.14 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 13962 root 20 0 130196 2996 2688 S 0.0 0.0 0:00.00 dmstats top - 14:04:31 up 4 days, 5:09, 15 users, load average: 1.02, 0.67, 0.36 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 13962 root 20 0 130196 2996 2688 S 0.3 0.0 0:00.32 dmstats This also affects report output for repeating reports in the DM_REPORT_OUTPUT_COLUMNS_AS_ROWS case; row state is not fully cleared for the next iteration leading to progressive growth of the heading width: vg_hex-lv_home:vg_hex-lv_swap:vg_hex-lv_root:luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:vg_hex-lv_images 253:253:253:253:253 2:0:1:4:3 L--w:L--w:L--w:L--w:L--w 1:2:1:1:1 3:1:1:1:2 0:0:0:0:0 LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiv08BCGvF4WsJSqWUDUt7qtf2hEmjtVvo:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiKf7XIiwdAYOJfaGhQe9fu26cTEICGgFS:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiEZj7ZXbmrWDuGhd7vvi88VF0NdTMG8iA:CRYPT-LUKS1-797339213f684c929eb7d0aca4c6ba3e-luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOi2rKredlBPnw2X7v1BiCuEpFo6gaE7BRw :::::vg_hex-lv_home:vg_hex-lv_swap:vg_hex-lv_root:luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:vg_hex-lv_images :::::253:253:253:253:253 :::::2:0:1:4:3 :::::L--w:L--w:L--w:L--w:L--w :::::1:2:1:1:1 :::::3:1:1:1:2 :::::0:0:0:0:0 :::::LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiv08BCGvF4WsJSqWUDUt7qtf2hEmjtVvo:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiKf7XIiwdAYOJfaGhQe9fu26cTEICGgFS:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiEZj7ZXbmrWDuGhd7vvi88VF0NdTMG8iA:CRYPT-LUKS1-797339213f684c929eb7d0aca4c6ba3e-luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOi2rKredlBPnw2X7v1BiCuEpFo6gaE7BRw
* libdm: ensure new dm_timestamp objects are initializedBryn M. Reeves2015-08-081-1/+1
| | | | | Allocate a dm_timestamp with dm_zalloc() to ensure the memory is initialized to a known state.
* man: mention system ID in vgexport and vgimportDavid Teigland2015-08-072-2/+8
|
* man: add lockd bits to relevant commandsDavid Teigland2015-08-074-1/+56
|
* man lvmlockd: updateDavid Teigland2015-08-071-280/+269
|
* man lvmcache: mention LVs must be in the same VGDavid Teigland2015-08-061-1/+1
|
* lvmlockd: handle loss of sanlock lease storageDavid Teigland2015-08-057-85/+415
| | | | | | | | | | | | | | This adds the infrastructure, code paths, error reporting, etc. to handle storage errors, or storage loss, under the sanlock leases in a VG that is being used. The loss of storage means sanlock cannot renew its leases, which means that the host needs to stop using the shared VG before its leases expire. This still requires manually shutting down a VG that has lost lease storage, e.g. unmounting file systems, deactivating LVs in the VG. The next step is to automatically use a command like blkdeactivate to do that.
* dmsetup: Report timestamps of ioctls with -vvv.Alasdair G Kergon2015-08-058-20/+93
| | | | If enabled, record timestamp immediately after the ioctl() returns.
* libdm: Whitespace.Alasdair G Kergon2015-08-051-13/+13
|
* libdm: Whitespace.Alasdair G Kergon2015-08-051-10/+10
|