diff options
author | NeilBrown <neilb@suse.de> | 2006-10-03 12:15:56 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-03 19:04:18 +0400 |
commit | f022b2fddd97795bc9333ffb6862eacfa95c6a95 (patch) | |
tree | 93615a8cbc489a1adb3cca7a3bf7c0e67625e4be /drivers/md/raid5.c | |
parent | 0d12922823408b26f83b15cae4a4feff4bd22f28 (diff) | |
download | linux-f022b2fddd97795bc9333ffb6862eacfa95c6a95.tar.xz |
[PATCH] md: add a ->congested_fn function for raid5/6
This is very different from other raid levels and all requests go through a
'stripe cache', and it has congestion management already.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 6cea9c9a98e2..37e4ff661b6c 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -2593,6 +2593,24 @@ static int raid5_issue_flush(request_queue_t *q, struct gendisk *disk, return ret; } +static int raid5_congested(void *data, int bits) +{ + mddev_t *mddev = data; + raid5_conf_t *conf = mddev_to_conf(mddev); + + /* No difference between reads and writes. Just check + * how busy the stripe_cache is + */ + if (conf->inactive_blocked) + return 1; + if (conf->quiesce) + return 1; + if (list_empty_careful(&conf->inactive_list)) + return 1; + + return 0; +} + static int make_request(request_queue_t *q, struct bio * bi) { mddev_t *mddev = q->queuedata; @@ -3296,6 +3314,9 @@ static int run(mddev_t *mddev) mddev->queue->unplug_fn = raid5_unplug_device; mddev->queue->issue_flush_fn = raid5_issue_flush; + mddev->queue->backing_dev_info.congested_fn = raid5_congested; + mddev->queue->backing_dev_info.congested_data = mddev; + mddev->array_size = mddev->size * (conf->previous_raid_disks - conf->max_degraded); |