lkml.org 
[lkml]   [2008]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Problems with the block-layer timeouts
On Thu, Nov 06 2008, FUJITA Tomonori wrote:
> On Mon, 3 Nov 2008 09:52:48 +0100
> Jens Axboe <jens.axboe@oracle.com> wrote:
>
> > > In blk_del_timer(), there's no reason to test q->rq_timed_out_fn. If
> > > the method pointer is NULL then req->deadline would be 0 anyway. In
> > > addition, req->deadline should be set to 0 and the end of the routine,
> > > just in case req gets requeued.
> > >
> > > In blk_add_timer(), the line
> > >
> > > expiry = round_jiffies(req->deadline);
> > >
> > > is not optimal. round_jiffies() will sometimes round a value _down_ to
> > > the nearest second. But blk_rq_timed_out_timer() tests whether
> > > req->deadline is in the past -- and if the deadline was rounded down
> > > then this won't be true the first time through. You wind up getting an
> > > unnecessary timer interrupt. Instead there should be a
> > > round_jiffies_up() utility routine, and it should be used in both
> > > blk_add_timer() and blk_rq_timed_out_timer().
> >
> > Very good point, we do indeed want a round_jiffies_up() for this!
>
> Just out of curiosity, why do we need to use round_jiffies here? We
> didn't do that for SCSI, right?

We don't have to, but given that we don't care about exact timeouts, we
may as well. It's not a new thing, we've done that since pretty much the
beginning of the generic timeout development.

--
Jens Axboe



\
 
 \ /
  Last update: 2008-11-06 08:29    [W:0.127 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site