1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

848 Commits

Author SHA1 Message Date
Zdenek Kabelac
4b586ad3c2 dmeventd: rework raid plugin
Switch to per-thread mem-pool and lock only for lvm2 calls.
Use libdm parser for raid status line.
2015-10-13 16:02:19 +02:00
Zdenek Kabelac
256e432e78 dmeventd: less locking mirror
Rework mirror plugin to use per-thread mem-pool.
This allows to use locking only for lvm2 library calls.
2015-10-13 16:02:18 +02:00
Zdenek Kabelac
51ff7d5ed8 dmeventd: less locking for snapshot and thin
Use lvm lock for lvm library calls.

dm functions in-use are 'thread-safe' since we use
local per-thread mem pool.
2015-10-13 16:01:41 +02:00
Zdenek Kabelac
49e11102c7 dmeventd: add local mempool for raid and mirror
Using local mempools allows to drop locks when such memory is needed.
2015-10-13 15:56:23 +02:00
Zdenek Kabelac
76ea01dd20 dmeventd: new initialization of plugin threads
Rework thread creation code to better use resources.

New code will not leak 'timeout' registered thread on error path.

Also if the thread already exist - avoid creation of thread
object and it's later destruction.

If the race is noticed during adding new monitoring thread,
such thread is put on cleanup list and -EEXIST is reported.
2015-10-13 15:55:05 +02:00
Zdenek Kabelac
e261af52eb dmeventd: handle snapshot overflow
When snapshot reports overflow, handle it in the same way as Invalid.
Until better ideas are implemented.
2015-10-13 15:15:44 +02:00
Zdenek Kabelac
915f0faac1 dmeventd: syslog -> log_xxxxx
Convert logging of dmeventd to libdm logging macros.
2015-10-13 14:43:30 +02:00
Zdenek Kabelac
7e1c08bb6a dmeventd: correct ret code for fail
As  _do_register_device() calls  register_device() function that returns
1 success & 0 fail -  ret = -ENOMEM for fail case instead of 0.
2015-10-13 14:38:49 +02:00
Zdenek Kabelac
5695c6aca6 libdm: enforce writethrough mode for cleaner
With "cleaner" policy always use 'writethrough' mode.
2015-10-13 14:35:48 +02:00
Peter Rajnoha
5f7a94a03e blkdeactivate: recognize and deactivate MD devices too 2015-10-06 13:25:41 +02:00
Alasdair G Kergon
0173c260d8 libdm: Move status fns from deptree to targets.
libdm-deptree is only for functions working with dm tree nodes.
2015-09-28 20:28:31 +01:00
Heinz Mauelshagen
4e60e62444 raid: Fix raid target write_behind parameter.
Now uses correct "max_write_behind" instead of "writebehind".
(Includes some tidying up.)
2015-09-23 15:53:27 +01:00
Peter Rajnoha
cb82919b0d systemd: use {local,remote}-fs-pre.target instead of {local,remote}-fs.target
We want most of our units to be started before any local/remote mount
points are mounted - we used {local,remote}-fs.target for this purpose
before, but it was not 100% correct as there's even {local,remote}-fs-pre.target
special systemd unit reserved for this exact purpose.

See also man 7 systemd.special and "local-fs-pre.target"/"remote-fs-pre.target"
description.
2015-09-23 13:30:51 +02:00
Alasdair G Kergon
3a8a37187d post-release 2015-09-22 16:06:07 +01:00
Alasdair G Kergon
629398d0f2 pre-release 2015-09-22 16:00:10 +01:00
Zdenek Kabelac
11d6f81316 man: enhance dmsetup/dmstats
Document more supported options.
Cleanup man-style when documenting options.
Use .PD 0  and .HP
2015-09-18 17:45:46 +02:00
Zdenek Kabelac
f9c8cefd06 dmsetup: improve help text
Document more options.
2015-09-18 17:45:45 +02:00
Zdenek Kabelac
791e76ff70 dmsetup: use noflush with force removal
When user specifies '--force' with remove/remove_all/wipe_table
use '--noflush --nolockfs' resume flags, so the operation
will not block when device underneath is blocked.
2015-09-18 17:45:45 +02:00
Zdenek Kabelac
e0d915a873 libdm: parse Overflow string from snapshot status
This is likely to be a new 'info' provided by kernel
snapshot target.
For now just parse this string.
2015-09-18 17:45:45 +02:00
Peter Rajnoha
5bc8c713e2 WHATS_NEW: commit 6c0b4a2769 2015-09-17 14:36:39 +02:00
Peter Rajnoha
afdae26c71 libdm: dev_node: use lstat instead of stat while removing and renaming nodes
When using udev, the /dev/mapper entries are symlinks - fix the code
to count with this.

This patch also fixes the dmsetup mknodes and vgmknodes to properly
repair /dev/mapper content if it sees dangling symlink in /dev/mapper.
2015-09-17 13:37:15 +02:00
Peter Rajnoha
b5022102bb libdm: report: make it possible to use blank value as selection for string list report field
$ lvs -o name,tags vg
  LV    LV Tags
  lvol0
  lvol1 mytag

Before this patch:
$ lvs -o name,tags vg -S 'tags=""'
  Failed to parse string list value for selection field lv_tags.
  Selection syntax error at 'tags=""'.
  Use 'help' for selection to get more help.

(and the same for -S 'tags={}' and -S 'tags=[]')

With this patch applied:
$ lvs -o name,tags vg -S 'tags=""'
  LV    LV Tags
  lvol0

(and the same for -S 'tags={}' and -S 'tags=[]')
2015-09-17 10:19:15 +02:00
Alasdair G Kergon
0ac10bb23a post-release 2015-09-15 14:09:10 +01:00
Alasdair G Kergon
a729b1aa29 pre-release 2015-09-15 13:17:50 +01:00
Zdenek Kabelac
c356991fa8 libdm: no validate for pool without messages
Avoid validation of free space in pool, when no messages are passed.

Patch a3c7e326c3 add new check for
pool overload - but this check should not be made if there are
no messages and transaction_id is still within 'bounds' (bigger by 1).
2015-09-14 20:18:54 +02:00
Alasdair G Kergon
2a022e9e6e post-release 2015-09-05 23:58:40 +01:00
Alasdair G Kergon
f5a3b05c7a pre-release 2015-09-05 23:46:22 +01:00
Bryn M. Reeves
f868624f85 WHATS_NEW_DM: fix histogram entries for 1.02.107
The histogram entries were under the wrong version (1.02.106). Fix
that and describe the library changes in more detail.
2015-09-04 19:53:10 +01:00
Zdenek Kabelac
a3c7e326c3 libdm: relocate parsing of thin-pool status
Use single routine for parsing status.

Internally we do not need to allocate pool memory for
passed struct.
2015-09-03 23:34:36 +02:00
Peter Rajnoha
fc35b6988d libdm: pkgconfig: fix devmapper.pc to not reference nonexistent rt.pc file
librt doesn't have a pkgconfig file so use Libs.private: -lrt instead
to declare the dependency directly.

The same applies for -lm which is also used and which hasn't been
defined in the devmapper.pc file yet.
2015-09-03 09:28:42 +02:00
Bryn M. Reeves
3c0fc6f0da dmstats: add histogram support
Add support to dmstats to create and report histograms.

Add a --histogram switch to 'create' that accepts a string
description of bin boundaries and DR_STATS and DR_STATS_META fields
to report bin configuration and absolute and relative histogram
values:

  hist_bins
  hist_bounds
  hist_ranges
  hist_count
  hist_count_bounds
  hist_count_ranges
  hist_percent
  hist_percent_bounds
  hist_percent_ranges

A new 'histogram' subcommand displays a report that emphasizes
histogram data as either counters or percentage values.
2015-09-02 21:02:12 +01:00
Bryn M. Reeves
a0cf3d47f1 libdm: add latency histogram support
Add support for creating, parsing, and reporting dm-stats latency
histograms on kernels that support precise_timestamps.

Histograms are specified as a series of time values that give the
boundaries of the bins into which I/O counts accumulate (with
implicit lower and upper bounds on the first and last bins).

A new type, struct dm_histogram, is introduced to represent
histogram values and bin boundaries.

The boundary values may be given as either a string of values (with
optional unit suffixes) or as a zero terminated array of uint64_t
values expressing boundary times in nanoseconds.

A new bounds argument is added to dm_stats_create_region() which
accepts a pointer to a struct dm_histogram initialised with bounds
values.

Histogram data associated with a region is parsed during a call to
dm_stats_populate() and used to build a table of histogram values
that are pointed to from the containing area's counter set. The
histogram for a specified area may then be obtained and interogated
for values and properties.

This relies on kernel support to provide the boundary values in
a @stats_list response: this will be present in 4.3 and 4.2-stable. A
check for a minimum driver version of 4.33.0 is implemented to ensure
that this is present (4.32.0 has the necessary precise_timestamps and
histogram features but is unable to report these via @stats_list).

Access methods are provided to retrieve histogram values and bounds
as well as simple string representations of the counts and bin
boundaries.  Methods are also available to return the total count
for a histogram and the relative value (as a dm_percent_t) of a
specified bin.
2015-09-02 20:48:59 +01:00
Alasdair G Kergon
cb57f4f89b libdm: Reinstate dm_task_get_info@Base.
Move the version script local:* wildcard into a node of its own
to avoid conflicting with in-source export macro definitions.
2015-09-01 16:26:02 +01:00
Alasdair G Kergon
d797f4d590 post-release 2015-08-26 23:13:34 +01:00
Alasdair G Kergon
a37fd93fbb pre-release 2015-08-26 23:11:13 +01:00
Bryn M. Reeves
463f59eca4 dmstats: add 'precise' flag field to stats report
Add a flag indicating whether or not precise_timestamps are enabled for
a given region or area.
2015-08-24 20:03:21 +01:00
Bryn M. Reeves
e4145ebc47 dmstats: add --precise switch to enable nanosecond counters. 2015-08-24 20:03:21 +01:00
Bryn M. Reeves
f4262026b6 libdm: add precise timestamps support to libdm-stats
Add support for the kernel precise_timestamps feature. This allows
regions to be created using counters with nanosecond precision.

A new dm_stats method, dm_stats_set_precise_timestamps() causes all
future regions created with this handle to attempt to enable precise
counters.
2015-08-24 20:03:21 +01:00
Alasdair G Kergon
d1c65d1b28 post-release 2015-08-17 17:26:20 +01:00
Alasdair G Kergon
be1db6b6c1 pre-release 2015-08-17 17:20:14 +01:00
Alasdair G Kergon
b297d78367 WHATS_NEW: Update. 2015-08-16 01:16:16 +01:00
Bryn M. Reeves
4d5b618d52 WHATS_NEW_DM: recent commits (stats field split and timestamp headers) 2015-08-14 13:43:12 +01:00
Alasdair G Kergon
043fb32c4b dmsetup: Restructure arg handling.
Introduce enums and global variables to record cleanly which command we
are processing and eliminate the historically inconsistent use of the
shifted argv[0] and fix assorted bugs discovered along the way.

Add dm_report_is_empty() to indicate there is no data awaiting output
and use this to suppress dmsetup report headings when no data is output
so we don't get a stray line saying 'Help' at the end of reporting help.

Define a report type (as the interface requires) so -o all selects
the right fields in splitname.  (A fix for stats list will follow.)

Exit immediately if no device is supplied to dmsetup wipe_table instead
of hitting errors later and failing.

Adjust the command name printed in usage/help output to match command
invoked (most of the time).
2015-08-13 22:30:39 +01:00
Bryn M. Reeves
6b81ac5807 dmstats: replace --force with new stats-specific --alldevices
The '--force' switch is only used by dmstats to allow either
creation or deletion of one or more regions on all devices.

These operations do not carry any risk: just a possible mess of
region IDs to be cleaned up.

Remove the use of '--force' for stats commands and change current
uses to a new '--alldevices' switch.
2015-08-13 19:05:46 +01:00
Zdenek Kabelac
08f047eb51 libdm: cache target arg validation
Add some arg validation for dm_tree_node_add_cache_target().
2015-08-12 14:33:15 +02:00
Alasdair G Kergon
5383697c78 post-release 2015-08-10 01:02:31 +01:00
Alasdair G Kergon
0b05048341 pre-release 2015-08-10 00:40:42 +01:00
Bryn M. Reeves
d62a8d2f15 dmstats: add libdm-stats library and 'dmsetup stats' command
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.
2015-08-09 14:37:58 +01:00
Bryn M. Reeves
f06d866110 WHATS_NEW_DM: Update for preliminary stats commits
Add entries for dm_report_column_headings() and report row leaks
and remove the dm_report interval/wait entry.
2015-08-08 17:48:30 +01:00
Alasdair G Kergon
559ca8bc65 dmsetup: Report timestamps of ioctls with -vvv.
If enabled, record timestamp immediately after the ioctl() returns.
2015-08-05 08:28:35 +01:00