Files
apfstests/common/cgroup2
T
Brian Foster 17d70b52f5 shared: cgroup aware writeback accounting test
A test to perform reads/writes under various cgroups and verify that
I/Os are accounted properly according to cgroup aware writeback.
This is a generic test, but not all commonly used local filesystems
support cgroup aware writeback at the moment (i.e., XFS). Therefore,
this test currently requires ext4 or btrfs for the time being.

The common/cgroup2 file is copied from a separate cgroup related
patch from Shaohua Li that never made it upstream.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-02-16 21:55:13 +08:00

16 lines
355 B
Plaintext

# cgroup2 specific common functions
export CGROUP2_PATH="${CGROUP2_PATH:-/sys/fs/cgroup}"
_require_cgroup2()
{
if [ ! -f "${CGROUP2_PATH}/cgroup.subtree_control" ]; then
_notrun "Test requires cgroup2 enabled"
fi
if [[ ! $(cat ${CGROUP2_PATH}/cgroup.controllers) =~ $1 ]]; then
_notrun "Cgroup2 doesn't support $1 controller $1"
fi
}
/bin/true