From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bartlomiej Zolnierkiewicz Date: Wed, 18 Nov 2009 22:10:31 +0000 Subject: Re: [PATCH] [RFC] Add support for uevents on block device idle changes Message-Id: <200911182310.31935.bzolnier@gmail.com> List-Id: References: <1258468659-5446-1-git-send-email-mjg@redhat.com> In-Reply-To: <1258468659-5446-1-git-send-email-mjg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Matthew Garrett Cc: linux-kernel@vger.kernel.org, axboe@kernel.dk, linux-hotplug@vger.kernel.org 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