Re: [PATCH] [RFC] Add support for uevents on block device idle changes

Bartlomiej Zolnierkiewicz
2009-11-18T22:12:10Z

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