[PATCH 3/7] bio-cgroup: Introduction

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ryo Tsuruta
Date: Monday, August 4, 2008 - 1:57 am

With this series of bio-cgruop patches, you can determine the owners of any
type of I/Os and it makes dm-ioband -- I/O bandwidth controller --
be able to control the Block I/O bandwidths even when it accepts
delayed write requests.
Dm-ioband can find the owner cgroup of each request.
It is also possible that the other people who work on the I/O
bandwidth throttling use this functionality to control asynchronous
I/Os with a little enhancement.

You have to apply the patch dm-ioband v1.4.0 before applying this series
of patches.

And you have to select the following config options when compiling kernel:
  CONFIG_CGROUPS=y
  CONFIG_CGROUP_BIO=y
And I recommend you should also select the options for cgroup memory
subsystem, because it makes it possible to give some I/O bandwidth
and some memory to a certain cgroup to control delayed write requests
and the processes in the cgroup will be able to make pages dirty only
inside the cgroup even when the given bandwidth is narrow.
  CONFIG_RESOURCE_COUNTERS=y
  CONFIG_CGROUP_MEM_RES_CTLR=y

This code is based on some part of the memory subsystem of cgroup
and I don't think the accuracy and overhead of the subsystem can be ignored
at this time, so we need to keep tuning it up.

 --------------------------------------------------------

The following shows how to use dm-ioband with cgroups.
Please assume that you want make two cgroups, which we call "bio cgroup"
here, to track down block I/Os and assign them to ioband device "ioband1".

First, mount the bio cgroup filesystem.

 # mount -t cgroup -o bio none /cgroup/bio

Then, make new bio cgroups and put some processes in them.

 # mkdir /cgroup/bio/bgroup1
 # mkdir /cgroup/bio/bgroup2
 # echo 1234 > /cgroup/bio/bgroup1/tasks
 # echo 5678 > /cgroup/bio/bgroup1/tasks

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

 # cat /cgroup/bio/bgroup1/bio.id
   1
 # cat /cgroup/bio/bgroup2/bio.id
   2

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

 # dmsetup message ioband1 0 type cgroup
 # dmsetup message ioband1 0 attach 1
 # dmsetup message ioband1 0 attach 2
 # dmsetup message ioband1 0 weight 1:30
 # dmsetup message ioband1 0 weight 2:60

You can also make use of the dm-ioband administration tool if you want.
The tool will be found here:
http://people.valinux.co.jp/~kaizuka/dm-ioband/iobandctl/manual.html
You can set up the device with the tool as follows.
In this case, you don't need to know the IDs of the cgroups.

 # iobandctl.py group /dev/mapper/ioband1 cgroup /cgroup/bio/bgroup1:30 /cgroup/bio/bgroup2:60
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/7] dm-ioband: Patch of device-mapper driver, Ryo Tsuruta, (Mon Aug 4, 1:52 am)
[PATCH 3/7] bio-cgroup: Introduction, Ryo Tsuruta, (Mon Aug 4, 1:57 am)
[PATCH 5/7] bio-cgroup: Remove a lot of ifdefs, Ryo Tsuruta, (Mon Aug 4, 1:59 am)
[PATCH 6/7] bio-cgroup: Implement the bio-cgroup, Ryo Tsuruta, (Mon Aug 4, 2:00 am)
Too many I/O controller patches, Dave Hansen, (Mon Aug 4, 10:20 am)
Re: Too many I/O controller patches, Andrea Righi, (Mon Aug 4, 11:22 am)
Re: Too many I/O controller patches, Balbir Singh, (Mon Aug 4, 11:34 am)
Re: Too many I/O controller patches, Dave Hansen, (Mon Aug 4, 12:02 pm)
Re: Too many I/O controller patches, Andrea Righi, (Mon Aug 4, 1:42 pm)
Re: Too many I/O controller patches, Andrea Righi, (Mon Aug 4, 1:44 pm)
Re: Too many I/O controller patches, Dave Hansen, (Mon Aug 4, 1:50 pm)
RE: Too many I/O controller patches, Satoshi UCHIDA, (Mon Aug 4, 7:50 pm)
Re: Too many I/O controller patches, Paul Menage, (Mon Aug 4, 10:55 pm)
Re: Too many I/O controller patches, Balbir Singh, (Mon Aug 4, 11:03 pm)
Re: Too many I/O controller patches, Hirokazu Takahashi, (Mon Aug 4, 11:16 pm)
Re: Too many I/O controller patches, Hirokazu Takahashi, (Mon Aug 4, 11:28 pm)
Re: Too many I/O controller patches, Andrea Righi, (Tue Aug 5, 2:27 am)
Re: Too many I/O controller patches, Andrea Righi, (Tue Aug 5, 2:28 am)
Re: Too many I/O controller patches, Andrea Righi, (Tue Aug 5, 2:31 am)
Re: Too many I/O controller patches, Hirokazu Takahashi, (Tue Aug 5, 3:01 am)
Re: [PATCH 4/7] bio-cgroup: Split the cgroup memory subsys ..., Hirokazu Takahashi, (Tue Aug 5, 3:35 am)
Re: Too many I/O controller patches, Hirokazu Takahashi, (Tue Aug 5, 5:01 am)
Re: Too many I/O controller patches, Ryo Tsuruta, (Tue Aug 5, 6:17 am)
Re: Too many I/O controller patches, Dave Hansen, (Tue Aug 5, 9:20 am)
Re: Too many I/O controller patches, Dave Hansen, (Tue Aug 5, 9:25 am)
Re: Too many I/O controller patches, KAMEZAWA Hiroyuki, (Tue Aug 5, 7:44 pm)
Re: Too many I/O controller patches, Balbir Singh, (Tue Aug 5, 8:30 pm)
Re: RFC: I/O bandwidth controller, Ryo Tsuruta, (Tue Aug 5, 11:18 pm)
Re: RFC: I/O bandwidth controller, Fernando Luis , (Tue Aug 5, 11:41 pm)
Re: Too many I/O controller patches, Hirokazu Takahashi, (Tue Aug 5, 11:48 pm)
Re: [PATCH 4/7] bio-cgroup: Split the cgroup memory subsys ..., KAMEZAWA Hiroyuki, (Wed Aug 6, 12:54 am)
Re: [PATCH 4/7] bio-cgroup: Split the cgroup memory subsys ..., Hirokazu Takahashi, (Wed Aug 6, 4:43 am)
Re: RFC: I/O bandwidth controller, Dave Hansen, (Wed Aug 6, 8:48 am)
Re: RFC: I/O bandwidth controller, Fernando Luis , (Wed Aug 6, 9:38 pm)
Re: [PATCH 4/7] bio-cgroup: Split the cgroup memory subsys ..., Hirokazu Takahashi, (Thu Aug 7, 12:25 am)
Re: RFC: I/O bandwidth controller, Hirokazu Takahashi, (Thu Aug 7, 1:30 am)
Re: [PATCH 4/7] bio-cgroup: Split the cgroup memory subsys ..., Hirokazu Takahashi, (Thu Aug 7, 1:45 am)
Re: RFC: I/O bandwidth controller, Hirokazu Takahashi, (Thu Aug 7, 11:21 pm)
Re: [PATCH 6/7] bio-cgroup: Implement the bio-cgroup, Takuya Yoshikawa, (Fri Aug 8, 12:10 am)
Re: RFC: I/O bandwidth controller, Ryo Tsuruta, (Fri Aug 8, 12:20 am)
Re: RFC: I/O bandwidth controller, Fernando Luis , (Fri Aug 8, 1:10 am)
Re: [PATCH 6/7] bio-cgroup: Implement the bio-cgroup, Ryo Tsuruta, (Fri Aug 8, 1:30 am)
Re: [PATCH 6/7] bio-cgroup: Implement the bio-cgroup, Takuya Yoshikawa, (Fri Aug 8, 2:42 am)
Re: RFC: I/O bandwidth controller, Ryo Tsuruta, (Fri Aug 8, 3:05 am)
Re: RFC: I/O bandwidth controller, Hirokazu Takahashi, (Fri Aug 8, 4:39 am)
Re: [PATCH 6/7] bio-cgroup: Implement the bio-cgroup, Ryo Tsuruta, (Fri Aug 8, 4:41 am)
Re: RFC: I/O bandwidth controller, Hirokazu Takahashi, (Fri Aug 8, 7:31 am)
Re: RFC: I/O bandwidth controller (was Re: Too many I/O co ..., David Collier-Brown, (Mon Aug 11, 9:35 am)
Re: RFC: I/O bandwidth controller, Fernando Luis , (Mon Aug 11, 10:35 pm)