Re: [PATCH] [RFC] Add support for uevents on block device idle changes
From: Bartlomiej Zolnierkiewicz
Date: Wed Nov 18 2009 - 17:12:21 EST
On Tuesday 17 November 2009 15:37:39 Matthew Garrett wrote:
> @@ -1452,6 +1452,15 @@ static inline void __generic_make_request(struct bio *bio)
> if (should_fail_request(bio))
> goto end_io;
>
> + if (bio->bi_bdev->bd_disk->hysteresis_time &&
> + bio_has_data(bio) &&
> + !mod_timer(&bio->bi_bdev->bd_disk->hysteresis_timer,
> + jiffies+msecs_to_jiffies
> + (bio->bi_bdev->bd_disk->hysteresis_time))) {
> + bio->bi_bdev->bd_disk->idle = 0;
> + schedule_work(&bio->bi_bdev->bd_disk->idle_notify);
> + }
> +
Wouldn't it be more reliable to hook into places where block requests are
issued/completed instead of queued? This way you will not miss special
requests (some of them are quite common in practice and may take a relatively
long time to execute, i.e. FLUSH CACHE).
--
Bartlomiej Zolnierkiewicz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/