Skip to content
Snippets Groups Projects
Commit 2bbcbbcc authored by Simon McVittie's avatar Simon McVittie
Browse files

cgroups test: log a warning if the scheduler does not appear to be cfq

Of the schedulers we compile, only cfq supports the block I/O weighting
feature that is exercised by test_blkio_weights_random_read and
test_blkio_weights_sequential_read.

Related to <https://bugs.apertis.org/show_bug.cgi?id=635

>

Reviewed-by: default avatarPhilip Withnall <philip.withnall@collabora.co.uk>
Signed-off-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D2165
parent 4ccba284
No related branches found
No related tags found
No related merge requests found
......@@ -142,6 +142,18 @@ _write_random_files() {
# Setup for blkio tests
_setup_blkio() {
root_partition="$(grep ' / ' /proc/self/mounts | cut -d' ' -f1 | grep -v '^rootfs$')"
root_drive="$(echo "${root_partition}" | sed -e 's,p\?[0-9]\+$,,')"
root_drive="${root_drive#/dev/}"
head -v /sys/block/${root_drive}/queue/scheduler 2>&1 | sed -e 's/^/# /'
case "$(cat /sys/block/${root_drive}/queue/scheduler)" in
(*\[cfq\]*)
;;
(*)
echo "WARNING: Block device scheduler does not appear to be cfq."
echo "This is probably not going to work, but trying it anyway..."
esac
_reset_cgroup blkio
# Set the resource allocation proportion
echo "# Configuring $MID_CG cgroup with blkio.weight = 1000"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment