aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-10-03 04:15:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:18 -0400
commitf022b2fddd97795bc9333ffb6862eacfa95c6a95 (patch)
tree93615a8cbc489a1adb3cca7a3bf7c0e67625e4be /drivers/md
parent0d12922823408b26f83b15cae4a4feff4bd22f28 (diff)
[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')
-rw-r--r--drivers/md/raid5.c21
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,
2593 return ret; 2593 return ret;
2594} 2594}
2595 2595
2596static int raid5_congested(void *data, int bits)
2597{
2598 mddev_t *mddev = data;
2599 raid5_conf_t *conf = mddev_to_conf(mddev);
2600
2601 /* No difference between reads and writes. Just check
2602 * how busy the stripe_cache is
2603 */
2604 if (conf->inactive_blocked)
2605 return 1;
2606 if (conf->quiesce)
2607 return 1;
2608 if (list_empty_careful(&conf->inactive_list))
2609 return 1;
2610
2611 return 0;
2612}
2613
2596static int make_request(request_queue_t *q, struct bio * bi) 2614static int make_request(request_queue_t *q, struct bio * bi)
2597{ 2615{
2598 mddev_t *mddev = q->queuedata; 2616 mddev_t *mddev = q->queuedata;
@@ -3296,6 +3314,9 @@ static int run(mddev_t *mddev)
3296 3314
3297 mddev->queue->unplug_fn = raid5_unplug_device; 3315 mddev->queue->unplug_fn = raid5_unplug_device;
3298 mddev->queue->issue_flush_fn = raid5_issue_flush; 3316 mddev->queue->issue_flush_fn = raid5_issue_flush;
3317 mddev->queue->backing_dev_info.congested_fn = raid5_congested;
3318 mddev->queue->backing_dev_info.congested_data = mddev;
3319
3299 mddev->array_size = mddev->size * (conf->previous_raid_disks - 3320 mddev->array_size = mddev->size * (conf->previous_raid_disks -
3300 conf->max_degraded); 3321 conf->max_degraded);
3301 3322