Question about block cgroup for disk partition

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

 



Hi,

Recently we found a weird failure by running xfstests generic/563 on xfs or
ext4, when the test device is a general disk partition. If you don't want to
try xfstests, you can see below script[1].

If we test on a disk partition (e.g. /dev/sdb1 or /dev/nvme0n1p1), the cgroup's
io.stat always can't output the correct minor device number of the disk
partition. LVM or loop devices don't have this issue.

Is there any 'blk-cgroup' expert would like to help to answer this question?
Is this expected or it's a bug will be fixed later? It can be reproduced on
latest upstream kernel.

Thanks,
Zorro


[1]
# cat blkcgroup-test.sh 
#/bin/bash

umount /dev/nvme0n1p1 2>/dev/null
mkfs.xfs -f /dev/nvme0n1p1 >/dev/null 2>&1
mount /dev/nvme0n1p1 /mnt/scratch
major=$((0x`stat -L -c "%t" /dev/nvme0n1p1`))
minor=$((0x`stat -L -c "%T" /dev/nvme0n1p1`))
echo "$major:$minor"
echo "+io" > /sys/fs/cgroup/cgroup.subtree_control
echo $$ > /sys/fs/cgroup/cgroup.procs
rmdir /sys/fs/cgroup/mytest-cg
xfs_io -fc "pwrite 0 8m" /mnt/scratch/file >/dev/null 2>&1
umount /dev/nvme0n1p1 && mount /dev/nvme0n1p1 /mnt/scratch
stat /mnt/scratch/file >/dev/null
mkdir /sys/fs/cgroup/mytest-cg
echo $$ > /sys/fs/cgroup/mytest-cg/cgroup.procs
xfs_io -c "pread 0 8m" -c "pwrite 0 8m" -c fsync /mnt/scratch/file >/dev/null 2>&1
mkdir -p /sys/fs/cgroup
echo $$ > /sys/fs/cgroup/cgroup.procs
xfs_io -c fsync /mnt/scratch/file
cat /sys/fs/cgroup/mytest-cg/io.stat

[2]
259:1
259:0 rbytes=8388608 wbytes=8389632 rios=67 wios=12 dbytes=0 dios=0





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux