]> git.baikalelectronics.ru Git - kernel.git/commit
dm kcopyd: introduce configurable throttling
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 1 Mar 2013 22:45:49 +0000 (22:45 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Fri, 1 Mar 2013 22:45:49 +0000 (22:45 +0000)
commitc907605457171d2087b88e669f9dc6caaa7ad487
tree5285aa8b0c794da419133a209437b32a11aa8a8d
parent207fcf9a016dc04b7ccc38bcdf68eefe0451cd57
dm kcopyd: introduce configurable throttling

This patch allows the administrator to reduce the rate at which kcopyd
issues I/O.

Each module that uses kcopyd acquires a throttle parameter that can be
set in /sys/module/*/parameters.

We maintain a history of kcopyd usage by each module in the variables
io_period and total_period in struct dm_kcopyd_throttle. The actual
kcopyd activity is calculated as a percentage of time equal to
"(100 * io_period / total_period)".  This is compared with the user-defined
throttle percentage threshold and if it is exceeded, we sleep.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-kcopyd.c
drivers/md/dm-raid1.c
drivers/md/dm-snap.c
drivers/md/dm-thin.c
include/linux/dm-kcopyd.h