RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1152795 - LVM cache: Add cache statistics to 'lvs'
Summary: LVM cache: Add cache statistics to 'lvs'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.1
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: rc
: 7.1
Assignee: Peter Rajnoha
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 1119326
TreeView+ depends on / blocked
 
Reported: 2014-10-15 01:09 UTC by Jonathan Earl Brassow
Modified: 2023-03-08 07:27 UTC (History)
7 users (show)

Fixed In Version: lvm2-2.02.112-1.el7
Doc Type: Enhancement
Doc Text:
There are new reporting fields to display cache statistics: cache_total_blocks, cache_used_blocks, cache_dirty_blocks, cache_read_hits, cache_read_misses, cache_write_hits, cache_write_misses.
Clone Of:
Environment:
Last Closed: 2015-03-05 13:09:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0513 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2015-03-05 16:14:41 UTC

Description Jonathan Earl Brassow 2014-10-15 01:09:08 UTC
We should be able to print out the following cache statistics which is available via the kernel (dmsetup status):
- cache block size (i.e. chunk size)
- total cache blocks
- used cache blocks
- dirty cache blocks
- read hits
- read misses
- write hits
- write misses

Comment 1 Jonathan Earl Brassow 2014-10-15 01:11:26 UTC
lv_cache_block_info should give you access to a number of these.

Comment 2 Peter Rajnoha 2014-10-24 12:56:59 UTC
Patchset it on dev-prajnoha-lv-segment-status-reporting devel branch now:

https://git.fedorahosted.org/cgit/lvm2.git/log/?h=dev-prajnoha-lv-segment-status-reporting

I'll test it a bit now. For now, I've added only reporting fields for the cache:

  Logical Volume Device Segment Status Fields
  -------------------------------------------
    seg_all                - All fields in this section.
    cache_total_blocks     - Total cache blocks.
    cache_used_blocks      - Used cache blocks.
    cache_dirty_blocks     - Dirty cache blocks.
    cache_read_hits        - Cache read hits.
    cache_read_misses      - Cache read misses.
    cache_write_hits       - Cache write hits.
    cache_write_misses     - Cache write misses.

But the code can be reused for current status on any other segtype as well later on...

Comment 3 Peter Rajnoha 2014-11-11 12:23:03 UTC
(In reply to Peter Rajnoha from comment #2)
> Patchset it on dev-prajnoha-lv-segment-status-reporting devel branch now:
> 
> https://git.fedorahosted.org/cgit/lvm2.git/log/?h=dev-prajnoha-lv-segment-
> status-reporting
> 

The original patchset was modified a bit so it's possbile to report one-segment LVs as usual LVs, not switching the overall reporting type to 'segment reporting' (which would exhibit more lines if some other LVs consist of several segments).

Cache LVs are also such LVs - they consist only of one segment for which we need to report the status as it was for the LV itself.

So there are two types now - LVSSTATUS for reporting segment status for exactly one segment that is chosen from the LV and SEGSSTATUS which is the same, but per-each-segment status reporting (if the LV consists of more than one segment - this is not yet used though but it's prepared for any future use).

The new patchset is here - committed upstream:

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=d7e5f038887be820874522674a51071705439c8e
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=7f90ad84c1f9bbc51a833b7ebb6459842405de52
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=a2c1024f6ac7e22ac5c010a267d0c1df331ee416
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=2dde6c6531f9a06896ae61f0878745542b4001b6

Comment 5 Corey Marthaler 2014-11-17 23:43:29 UTC
Marking verified (SanityOnly). All these fields are present in the latest rpms.


3.10.0-200.el7.bz1159001v2.x86_64
lvm2-2.02.112-1.el7    BUILT: Tue Nov 11 09:39:35 CST 2014
lvm2-libs-2.02.112-1.el7    BUILT: Tue Nov 11 09:39:35 CST 2014
lvm2-cluster-2.02.112-1.el7    BUILT: Tue Nov 11 09:39:35 CST 2014
device-mapper-1.02.91-1.el7    BUILT: Tue Nov 11 09:39:35 CST 2014
device-mapper-libs-1.02.91-1.el7    BUILT: Tue Nov 11 09:39:35 CST 2014
device-mapper-event-1.02.91-1.el7    BUILT: Tue Nov 11 09:39:35 CST 2014
device-mapper-event-libs-1.02.91-1.el7    BUILT: Tue Nov 11 09:39:35 CST 2014
device-mapper-persistent-data-0.3.2-1.el7    BUILT: Thu Apr  3 09:58:51 CDT 2014
cmirror-2.02.112-1.el7    BUILT: Tue Nov 11 09:39:35 CST 2014


[root@host-118 ~]# lvs -a -o +devices,cache_total_blocks,cache_used_blocks,cache_dirty_blocks,cache_read_hits,cache_read_misses,cache_write_hits,cache_write_misses,segtype
LV                             Attr       LSize   Pool            Origin                Data%  Meta% Cpy%Sync Devices                                                         CacheTotalBlocks CacheUsedBlocks  CacheDirtyBlocks CacheReadHits    CacheReadMisses  CacheWriteHits   CacheWriteMisses Type
[lvol0_pmspare]                ewi-------   8.00m                                                             /dev/sda2(0)                                                                                                                                                                           linear
rename_orig_A                  Cwi-aoC---   4.00g [rename_pool_A] [rename_orig_A_corig] 0.02   6.59  0.00     rename_orig_A_corig(0)                                                     65536               11                0              399               71               42             3143 cache
[rename_orig_A_corig]          rwi-aoC---   4.00g                                                    100.00   rename_orig_A_corig_rimage_0(0),rename_orig_A_corig_rimage_1(0)                                                                                                                        raid1
[rename_orig_A_corig_rimage_0] iwi-aor---   4.00g                                                             /dev/sdc1(1)                                                                                                                                                                           linear
[rename_orig_A_corig_rimage_1] iwi-aor---   4.00g                                                             /dev/sda1(1)                                                                                                                                                                           linear
[rename_orig_A_corig_rmeta_0]  ewi-aor---   4.00m                                                             /dev/sdc1(0)                                                                                                                                                                           linear
[rename_orig_A_corig_rmeta_1]  ewi-aor---   4.00m                                                             /dev/sda1(0)                                                                                                                                                                           linear
[rename_pool_A]                Cwi---C---   4.00g                                       0.02   6.59  0.00     rename_pool_A_cdata(0)                                                                                                                                                                 cache-pool
[rename_pool_A_cdata]          Cwi-aor---   4.00g                                                    100.00   rename_pool_A_cdata_rimage_0(0),rename_pool_A_cdata_rimage_1(0)                                                                                                                        raid1
[rename_pool_A_cdata_rimage_0] iwi-aor---   4.00g                                                             /dev/sdd2(1)                                                                                                                                                                           linear
[rename_pool_A_cdata_rimage_1] iwi-aor---   4.00g                                                             /dev/sdd1(1)                                                                                                                                                                           linear
[rename_pool_A_cdata_rmeta_0]  ewi-aor---   4.00m                                                             /dev/sdd2(0)                                                                                                                                                                           linear
[rename_pool_A_cdata_rmeta_1]  ewi-aor---   4.00m                                                             /dev/sdd1(0)                                                                                                                                                                           linear
[rename_pool_A_cmeta]          ewi-aor---   8.00m                                                    100.00   rename_pool_A_cmeta_rimage_0(0),rename_pool_A_cmeta_rimage_1(0)                                                                                                                        raid1
[rename_pool_A_cmeta_rimage_0] iwi-aor---   8.00m                                                             /dev/sdd2(1026)                                                                                                                                                                        linear
[rename_pool_A_cmeta_rimage_1] iwi-aor---   8.00m                                                             /dev/sdd1(1026)                                                                                                                                                                        linear
[rename_pool_A_cmeta_rmeta_0]  ewi-aor---   4.00m                                                             /dev/sdd2(1025)                                                                                                                                                                        linear
[rename_pool_A_cmeta_rmeta_1]  ewi-aor---   4.00m                                                             /dev/sdd1(1025)                                                                                                                                                                        linear

Comment 6 Jiri Herrmann 2014-12-12 15:32:20 UTC
If this Feature should be included in the 7.1 Release Notes, could you please change the Doc Type from Enhancement to "Release Note"?

Note that the Release Notes are intended to list the most prominent and customer-relevant new features rather than every single enhancement.

Cheers,
Jirka

Comment 8 errata-xmlrpc 2015-03-05 13:09:48 UTC
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-0513.html


Note You need to log in before you can comment on or make changes to this bug.