fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about block cgroup for disk partition
@ 2019-11-17 14:16 Zorro Lang
  0 siblings, 0 replies; only message in thread
From: Zorro Lang @ 2019-11-17 14:16 UTC (permalink / raw)
  To: linux-block; +Cc: cgroups, bfoster, fstests

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-17 14:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-17 14:16 Question about block cgroup for disk partition Zorro Lang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).