System information

126 System Analysis and Tuning Guide
Anonymous and file cache.
No limits for kernel memory.
Maybe in another subsystem if needed.
For more information, see /usr/src/linux/Documenta
tion/cgroups/memory.txt.
Blkio (Resource Control)
The blkio (Block IO) controller is now available as a disk I/O controller. With the
blkio controller you can currently set policies for proportional bandwidth and for
throttling.
These are the basic commands to configure proportional weight division of band-
width by setting weight values in blkio.weight:
# Setup in /sys/fs/cgroup
mkdir /sys/fs/cgroup/blkio
mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
# Start two cgroups
mkdir -p /sys/fs/cgroup/blkio/group1 /sys/fs/cgroup/blkio/group2
# Set weights
echo 1000 > /sys/fs/cgroup/blkio/group1/blkio.weight
echo 500 > /sys/fs/cgroup/blkio/group2/blkio.weight
# Write the PIDs of the processes to be controlled to the
# appropriate groups
command1 &
echo $! > /sys/fs/cgroup/blkio/group1/tasks
command2 &
echo $! > /sys/fs/cgroup/blkio/group2/tasks
These are the basic commands to configure throttling or upper limit policy by
setting values in blkio.throttle.read_bps_device for reads and
blkio.throttle.write_bps_device for writes:
# Setup in /sys/fs/cgroup
mkdir /sys/fs/cgroup/blkio
mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
# Bandwidth rate of a device for the root group; format:
# <major>:<minor> <byes_per_second>
echo "8:16 1048576" > /sys/fs/cgroup/blkio/
blkio.throttle.read_bps_device
For more information about caveats, usage scenarios, and additional para-
meters, see /usr/src/linux/Documentation/cgroups/blkio-
controller.txt.