Bug 1222101
| Summary: | add IO statistics reporting to dmsetup | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Bryn M. Reeves <bmr> | |
| Component: | lvm2 | Assignee: | Bryn M. Reeves <bmr> | |
| lvm2 sub component: | dmsetup | QA Contact: | Bruno Goncalves <bgoncalv> | |
| Status: | CLOSED ERRATA | Docs Contact: | Steven J. Levine <slevine> | |
| Severity: | medium | |||
| Priority: | medium | CC: | agk, bgoncalv, bmr, cmarthal, heinzm, jbrassow, jeder, msnitzer, prajnoha, prockai, sgilson, tlavigne, zkabelac | |
| Version: | 7.1 | Keywords: | Triaged | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | lvm2-2.02.130-1.el7 | Doc Type: | Enhancement | |
| Doc Text: |
New dmstats command to display and manage I/O statistics for regions of devices that use the device-mapper driver
The `dmstats` command provides userspace support for device-mapper I/O statistics. This allows a user to create, manage and report I/O counters, metrics and latency histogram data for user-defined arbitrary regions of device-mapper devices. Statistics fields are now available in `dmsetup` reports and the `dmstats` command adds new specialized reporting modes designed for use with statistics information. For information on the `dmstats` command, see the dmstats(8) man page.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1254801 1267664 (view as bug list) | Environment: | ||
| Last Closed: | 2015-11-19 12:46:44 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | 1254801, 1267632 | |||
| Bug Blocks: | 1189089, 1246193 | |||
|
Description
Bryn M. Reeves
2015-05-15 18:39:18 UTC
New "dmstats" commands has been added in recent lvm2 v2.02.127 upstream which is going to be included in RHEL 7.2 device-mapper subpackage (device-mapper v 1.02.104, a subpackage of lvm2). See also man dmstats(8) for more info on usage. A small number of correctness patches (from Coverity reports) that are worth including: f072a76 libdm-stats: backtrace if fclose fails (Coverity) 856f9cc libdm: simplify stats nr_areas calculation (Coverity) ec87e88 dmsetup: don't free handle if dm_stats_create fails (Coverity) f9f5aac libdm: fix stats handle leak in dm_stats_create (Coverity) 1134de3 libdm: fix FILE leak in _program_id_from_proc() (Coverity) 3b74824 dmsetup: remove bogus !_report test in _stats_report (Coverity) These are all minor or hard to trigger: i.e. tiny leaks (one FILE object per handle created with NULL or empty program_id) or bugs in hard-to-trigger error paths but they are simple and very low-risk changes that fix real problems. In the course of development we discovered that we were missing the ability for the kernel to report back to userspace the 'precise_statistics' and 'histogram' settings used for each region. Without this information, the numbers that the kernel reports for these details cannot be interpreted. If a single process is handling everything, that process knows what data it asked the kernel to collect, so things are OK, but if two separate processes are involved (i.e. two separate invocations of 'dmstats'), userspace has to record the configuration somewhere semi-persistent that they both can access. Mikulas has provided a fix so that @stats_list reports this information back to userspace so that it doesn't have to be stored somewhere else: https://www.redhat.com/archives/dm-devel/2015-August/msg00123.html A viable workaround does exist: the kernel provides an "aux_data" storage facility for each registered region. This can be used to store the context information required to interpret the data for the region, e.g.: DMS_PRECISE,DMS_HIST=75000,100000,1000000,5000000,10000000| Indicates a region with precise_timestamps and a 6-binned histogram. The problem with this is that working around the lack of information from current kernels in this way would mean carrying this in libdevmapper userspace indefinitely. There are other planned uses for the feature however (e.g. grouping and aggregation) for which kernel support is not needed so the use of the aux_data area as a NVP store is likely to continue. removing tech preview keyword. We intend to fully support this feature in 7.2. Most of the remaining histogram patches are now upstream (along with a couple of minor doc fixes and a cleanup to the stats report fields): b86bd3b man: fix typo in dmstats.8.in 3414601 man: document --regionid in dmstats.8.in d31c4e0 man: update dmstats.8.in examples 031cd2b dmstats: improve stats column names 3c0fc6f dmstats: add histogram support a0cf3d4 libdm: add latency histogram support c4f3732 libdm: reset report field widths in _destroy_rows() The report patch is needed to ensure proper width calculation of histogram fields in repeating reports (since the first report is often very wide due to accumulated counts). I'll be adding an additional patch today to control number unit formatting in histogram data which should make this feature complete. 49b5022 dmstats: support --noheadings for histogram fields 84d88cb dmstats: add --notimesuffix switch f09e4f7 libdm: allow formatting histogram strings with no whitespace There's one important histogram patch that landed after 1.02.107: daa94eb libdm: fix display of nsec suffixes in histogram strings This fixes a significant bug in the display of nsec values in histogram boundary strings. Three other patches are cleanup and not essential: d7f45eb libdm: clean up stats local variable use 5f99047 libdm: clean up _build_histogram_arg() 4bc7a86 libdm: only free the first histogram explicitly (Coverity) Verified using: kernel-3.10.0-316.el7 lvm2-2.02.130-2.el7 # dmstats create --alldevices --precise rhel_ibm--ls22--02-home: Created new region with 1 area(s) as region ID 0 rhel_ibm--ls22--02-swap: Created new region with 1 area(s) as region ID 0 rhel_ibm--ls22--02-root: Created new region with 1 area(s) as region ID 0 # dmstats list -o +precise Name RgID RgSta RgSize #Areas ArSize ProgID Precise rhel_ibm--ls22--02-home 0 0 77.54g 1 77.54g dmstats 1 rhel_ibm--ls22--02-swap 0 0 7.88g 1 7.88g dmstats 1 rhel_ibm--ls22--02-root 0 0 50.00g 1 50.00g dmstats 1 # dmstats create --start 10g --len 10g rhel_ibm--ls22--02-home rhel_ibm--ls22--02-home: Created new region with 1 area(s) as region ID 1 # dmstats create --precise --bounds 10ms,20ms,30ms rhel_ibm--ls22--02-root rhel_ibm--ls22--02-root: Created new region with 1 area(s) as region ID 1 # dmstats list --histogram Name RgID RgStar RgSize #Areas ArSize #Bins Histogram Bounds rhel_ibm--ls22--02-home 0 0 77.54g 1 77.54g 0 rhel_ibm--ls22--02-home 1 10.00g 10.00g 1 10.00g 0 rhel_ibm--ls22--02-swap 0 0 7.88g 1 7.88g 0 rhel_ibm--ls22--02-root 0 0 50.00g 1 50.00g 0 rhel_ibm--ls22--02-root 1 0 50.00g 1 50.00g 4 0s,10ms,20ms,30ms # dmstats list -o +precise,hist_bins Name RgID RgStar RgSize #Areas ArSize ProgID Precise #Bins rhel_ibm--ls22--02-home 0 0 77.54g 1 77.54g dmstats 1 0 rhel_ibm--ls22--02-home 1 10.00g 10.00g 1 10.00g dmstats 0 0 rhel_ibm--ls22--02-swap 0 0 7.88g 1 7.88g dmstats 1 0 rhel_ibm--ls22--02-root 0 0 50.00g 1 50.00g dmstats 1 0 rhel_ibm--ls22--02-root 1 0 50.00g 1 50.00g dmstats 1 4 # dmstats delete --regionid 1 rhel_ibm--ls22--02-home # # dmstats list --histogram Name RgID RgSta RgSize #Areas ArSize #Bins Histogram Bounds rhel_ibm--ls22--02-home 0 0 77.54g 1 77.54g 0 rhel_ibm--ls22--02-swap 0 0 7.88g 1 7.88g 0 rhel_ibm--ls22--02-root 0 0 50.00g 1 50.00g 0 rhel_ibm--ls22--02-root 1 0 50.00g 1 50.00g 4 0s,10ms,20ms,30ms # dmstats delete --allregions rhel_ibm--ls22--02-home # # dmstats list --histogram Name RgID RgSta RgSize #Areas ArSize #Bins Histogram Bounds rhel_ibm--ls22--02-swap 0 0 7.88g 1 7.88g 0 rhel_ibm--ls22--02-root 0 0 50.00g 1 50.00g 0 rhel_ibm--ls22--02-root 1 0 50.00g 1 50.00g 4 0s,10ms,20ms,30ms # dmstats delete --allregions --alldevices # # dmstats list --histogram # Updating the "doc text" field to prepare it for release notes. The way this now works is that the field is automatically picked up for the release notes build, which requires a single-sentence "title" summary followed by a blank line, then the description of the new feature. This is for "enhancements" specifically -- bug fixes have their standard bug fix formula. Writers are now assigned the bugs for release notes to edit this text into that format (and to generally edit the texts, but Bryn needs no editing.) So I added a title -- which is pretty much the first sentence of the Portal article draft -- and summarized what Bryn had written into one paragraph (which is his basic paragraph). I don't want to lose any information, of course, but the "reason" and "result" format made for some redundancy. (This is by way of explanation.) Editing title to be less than 120 characters. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2147.html |