Bug 1376563

Summary: unable to get dmstats file map to report any I/O operation stats
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Bryn M. Reeves <bmr>
lvm2 sub component: dmsetup QA Contact: cluster-qe <cluster-qe>
Status: CLOSED DUPLICATE Docs Contact:
Severity: high    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac
Version: 7.3   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-23 15:53:39 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:

Description Corey Marthaler 2016-09-15 18:04:56 UTC
Description of problem:

# Using exact same setup from bug 1376562

Verify/read all files previously written:
[root@host-117 ~]# /usr/tests/sts-rhel7.3/bin/checkit -w /mnt/lvol0 -f /tmp/checkio -v
checkit starting with:
VERIFY
Verify XIOR Stream: /tmp/checkio
Working dir:        /mnt/lvol0
[root@host-117 ~]# /usr/tests/sts-rhel7.3/bin/checkit -w /mnt/lvol0 -f /tmp/checkio -v
checkit starting with:
VERIFY
Verify XIOR Stream: /tmp/checkio
Working dir:        /mnt/lvol0
[root@host-117 ~]# /usr/tests/sts-rhel7.3/bin/checkit -w /mnt/lvol0 -f /tmp/checkio -v
checkit starting with:
VERIFY
Verify XIOR Stream: /tmp/checkio
Working dir:        /mnt/lvol0
[root@host-117 ~]# /usr/tests/sts-rhel7.3/bin/checkit -w /mnt/lvol0 -f /tmp/checkio -v
checkit starting with:
VERIFY
Verify XIOR Stream: /tmp/checkio
Working dir:        /mnt/lvol0

# No change in stat performance
[root@host-117 ~]# dmstats report --group
Name                 GrpID RgID ObjType ArID ArStart ArSize  RMrg/s WMrg/s R/s  W/s  RSz/s WSz/s AvgRqSz QSize Util% AWait RdAWait WrAWait
xjjcmoeftdcathggnism     0    0 group      0   8.63m 250.00k   0.00   0.00 0.00 0.00     0     0       0  0.00  0.00  0.00    0.00    0.00
vntwhckfhujdlh           1    1 group      0   9.36m 175.00k   0.00   0.00 0.00 0.00     0     0       0  0.00  0.00  0.00    0.00    0.00


# over write the file completely
[root@host-117 ~]# cp /root/anaconda-ks.cfg /mnt/lvol0/xjjcmoeftdcathggnism
cp: overwrite â/mnt/lvol0/xjjcmoeftdcathggnismâ? y

[root@host-117 ~]# sync
[root@host-117 ~]# echo 3 > /proc/sys/vm/drop_caches

# No change
[root@host-117 ~]# dmstats report --group
Name                 GrpID RgID ObjType ArID ArStart ArSize  RMrg/s WMrg/s R/s  W/s  RSz/s WSz/s AvgRqSz QSize Util% AWait RdAWait WrAWait
xjjcmoeftdcathggnism     0    0 group      0   8.63m 250.00k   0.00   0.00 0.00 0.00     0     0       0  0.00  0.00  0.00    0.00    0.00
vntwhckfhujdlh           1    1 group      0   9.36m 175.00k   0.00   0.00 0.00 0.00     0     0       0  0.00  0.00  0.00    0.00    0.00



 
# write and read zeros over and over
[root@host-117 ~]# for i in $(seq 0 20)
> do
> dd if=/dev/zero of=/mnt/lvol0/xjjcmoeftdcathggnism oflag=direct,sync bs=1M count=15
> dd if=/mnt/lvol0/xjjcmoeftdcathggnism of=/dev/null iflag=direct,sync bs=1M count=15
> done

# No change
[root@host-117 ~]# dmstats report --group
Name                 GrpID RgID ObjType ArID ArStart ArSize  RMrg/s WMrg/s R/s  W/s  RSz/s WSz/s AvgRqSz QSize Util% AWait RdAWait WrAWait
xjjcmoeftdcathggnism     0    0 group      0   8.63m 250.00k   0.00   0.00 0.00 0.00     0     0       0  0.00  0.00  0.00    0.00    0.00
vntwhckfhujdlh           1    1 group      0   9.36m 175.00k   0.00   0.00 0.00 0.00     0     0       0  0.00  0.00  0.00    0.00    0.00

[root@host-117 ~]# echo 3 > /proc/sys/vm/drop_caches
[root@host-117 ~]# sync

# Still no change
[root@host-117 ~]# dmstats report --group
Name                 GrpID RgID ObjType ArID ArStart ArSize  RMrg/s WMrg/s R/s  W/s  RSz/s WSz/s AvgRqSz QSize Util% AWait RdAWait WrAWait
xjjcmoeftdcathggnism     0    0 group      0   8.63m 250.00k   0.00   0.00 0.00 0.00     0     0       0  0.00  0.00  0.00    0.00    0.00
vntwhckfhujdlh           1    1 group      0   9.36m 175.00k   0.00   0.00 0.00 0.00     0     0       0  0.00  0.00  0.00    0.00    0.00


Version-Release number of selected component (if applicable):
3.10.0-501.el7.x86_64

lvm2-2.02.165-2.el7    BUILT: Wed Sep 14 09:01:43 CDT 2016
lvm2-libs-2.02.165-2.el7    BUILT: Wed Sep 14 09:01:43 CDT 2016
lvm2-cluster-2.02.165-2.el7    BUILT: Wed Sep 14 09:01:43 CDT 2016
device-mapper-1.02.134-2.el7    BUILT: Wed Sep 14 09:01:43 CDT 2016
device-mapper-libs-1.02.134-2.el7    BUILT: Wed Sep 14 09:01:43 CDT 2016
device-mapper-event-1.02.134-2.el7    BUILT: Wed Sep 14 09:01:43 CDT 2016
device-mapper-event-libs-1.02.134-2.el7    BUILT: Wed Sep 14 09:01:43 CDT 2016
device-mapper-persistent-data-0.6.3-1.el7    BUILT: Fri Jul 22 05:29:13 CDT 2016

Comment 2 Bryn M. Reeves 2016-09-16 09:25:37 UTC
I think the reason you're not actually re-writing the file - by default I think cp will unlink the destination and open(2) a new file, where dd does open the existing file, but using O_CREAT|O_TRUNC (i.e. all existing extents are released):

lseek(0, 0, SEEK_CUR)                   = 0
open("/var/tmp/foo", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
dup2(3, 1)                              = 1

This will be fixed when we implement inode monitoring and automatic refresh of the region table but until then we can only support in-place IO.

Comment 3 Bryn M. Reeves 2016-09-16 09:26:59 UTC
We should note this in the man page/release notes, or a kbase article - it's going to be fairly common with tools like cp/dd and is confusing for the user.

Comment 6 Bryn M. Reeves 2016-09-23 15:53:39 UTC

*** This bug has been marked as a duplicate of bug 1378956 ***