Incorrect results for device mapper statistics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Referring to this: https://www.kernel.org/doc/Documentation/device-mapper/statistics.txt

Basically it seems like a discard takes a certain amount of time, and the discard can span multiple statistic areas. Each area then claims it took that total amount of time for the discard, making the accounting of statistics incorrect. I think a solution would be to divide the amount of time by the number of areas, and attribute that to the individual area's stats. It wouldn't be perfect, but it would be much closer to accurate.

root@cloudthree:~# dmsetup create testing --table "0 100000 linear /dev/mapper/local-nvme 0"

root@cloudthree:~# stat /dev/mapper/testing
  File: /dev/mapper/testing -> ../dm-13

root@cloudthree:~# grep dm-13 /proc/diskstats
 253      13 dm-13 56 0 1312 0 0 0 0 0 0 0 0

root@cloudthree:~# dmstats create --areas 10 testing
testing: Created new region with 10 area(s) as region ID 0

root@cloudthree:~# blkdiscard /dev/dm-13

root@cloudthree:~# dmstats print --regionid 0 testing
0+10000 26 0 1072 0 1 1 10000 40 0 40 40 0 40
10000+10000 0 0 0 0 1 1 10000 40 0 40 40 0 40
20000+10000 0 0 0 0 1 1 10000 40 0 40 40 0 40
30000+10000 0 0 0 0 1 1 10000 40 0 40 40 0 40
40000+10000 0 0 0 0 1 1 10000 40 0 40 40 0 40
50000+10000 0 0 0 0 1 1 10000 40 0 40 40 0 40
60000+10000 0 0 0 0 1 1 10000 40 0 40 40 0 40
70000+10000 0 0 0 0 1 1 10000 40 0 40 40 0 40
80000+10000 0 0 0 0 1 1 10000 40 0 40 40 0 40
90000+10000 30 0 240 8 1 1 10000 40 0 48 48 8 40

root@cloudthree:~# grep dm-13 /proc/diskstats
 253      13 dm-13 112 0 2624 8 1 0 100000 40 0 48 48

The entire device has the correct stats, but the each area has the total time spent doing the discard for all areas.

Assuming https://github.com/torvalds/linux/blob/master/drivers/md/dm-stats.c is responsible for this, my guess is it maybe cannot account for this... and that things like discards and flushes are dealt with elsewhere. If I had a feature request, it would be for separate (correct) stats for discards.
--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux