LWN.net Logo

Which I/O controller is the fairest of them all?

Which I/O controller is the fairest of them all?

Posted May 13, 2009 9:20 UTC (Wed) by danpb (subscriber, #4831)
Parent article: Which I/O controller is the fairest of them all?

The combination of dm-ioband + blkio-cgroup ends up with a really overcomplicated userspace interface for controlling I/O. To quote from the blkio-cgroup announcement, you have todo:

[quote]
make new bio cgroups and put some processes in them.

# mkdir /cgroup/grp1
# mkdir /cgroup/grp2
# echo 1234 > /cgroup/grp1/tasks
# echo 5678 > /cgroup/grp2/tasks

Now, check the ID of each blkio cgroup which is just created.

# cat /cgroup/grp1/blkio.id
2
# cat /cgroup/grp2/blkio.id
3

Finally, attach the cgroups to "ioband1" and assign them weights.

# dmsetup message ioband1 0 type cgroup
# dmsetup message ioband1 0 attach 2
# dmsetup message ioband1 0 attach 3
# dmsetup message ioband1 0 weight 2:30
# dmsetup message ioband1 0 weight 3:60
[/quote]

Now, consider if this was done entirely within cgroups, without any use of dmsetup. You could achieve the same result with

[example]
make new bio cgroups and put some processes in them.

# mkdir /cgroup/grp1
# mkdir /cgroup/grp2
# echo 1234 > /cgroup/grp1/tasks
# echo 5678 > /cgroup/grp2/tasks

Then assign them weights.

# echo "2:30" > /cgroup/grp1/blkio.weight
# echo "3:60" > /cgroup/grp2/blkio.weight
[/example]

This has the added benefit that if you're writing management APIs for this, you only need to be able to create/delete files & directories, and not worry about spawning external processes like dm-setup. So when the time comes to use this capability in libvirt, I'm rather hoping the kernel guys have decided on a pure cgroups userspace interface without device-mapper in the way.


(Log in to post comments)

Which I/O controller is the fairest of them all?

Posted May 13, 2009 14:28 UTC (Wed) by vgoyal (subscriber, #49279) [Link]

Agreed that pure cgroup based interface for io control should be the goal as it makes the life easier for users of the infrastructure. IO scheduler based IO controller has got just cgroup interface to do the control and no need of device mapper tools.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds