OSDN Git Service

nullb: bandwidth control
authorShaohua Li <shli@fb.com>
Mon, 14 Aug 2017 22:04:58 +0000 (15:04 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 23 Aug 2017 14:54:09 +0000 (08:54 -0600)
commiteff2c4f108735ddfce37a912a133938d96d70356
treed93ea8591d9fb2a65f3e4fbffdc955a2249d776a
parent306eb6b4ad4f2d51c989b9e3d3a9271c44408431
nullb: bandwidth control

In test, we usually expect controllable disk speed. For example, in a
raid array, we'd like some disks are fast and some are slow. MD RAID
actually has a feature for this. To test the feature, we'd like to make
the disk run in specific speed.

block throttling probably can be used for this purpose, but it requires
cgroup setup. Here we just implement a simple throttling mechanism in
the driver. There is slight fluctuation in the mechanism, but it's good
enough for test.

To configure the bandwidth cap, user sets the 'mbps' attribute. mbps is
MB/s.

Based on original patch from Kyungchan Koh

Signed-off-by: Kyungchan Koh <kkc6196@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk.c