]> git.karo-electronics.de Git - karo-tx-linux.git/commit
This patch allows the administrator to reduce the rate at which kcopyd
authorMikulas Patocka <mpatocka@redhat.com>
Sun, 17 Feb 2013 23:03:35 +0000 (10:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sun, 17 Feb 2013 23:04:52 +0000 (10:04 +1100)
commit491d0377a7f5bb6dd6e8e27bc15f0f9f7310d029
tree08a823ef08c489b354f06f2b9f9631fd2f163c9a
parent41bc568643139e3e4423b4be926df1fa159b9008
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