public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	James.Bottomley@HansenPartnership.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Problems with the block-layer timeouts
Date: Tue, 11 Nov 2008 20:19:36 +0100	[thread overview]
Message-ID: <20081111191936.GK26778@kernel.dk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0811111205390.29125-100000@netrider.rowland.org>

On Tue, Nov 11 2008, Alan Stern wrote:
> On Tue, 11 Nov 2008, FUJITA Tomonori wrote:
> 
> > I don't worry about anything. I just think that these round_jiffies_up
> > are pointless because they were added for the block-layer users that
> > care about exact timeouts, however the block-layer doesn't export
> > blk_add_timer() so the block-layer users can't control the exact time
> > when the timer starts. So doing round_jiffies_up calculation per every
> > request doesn't make sense for me.
> 
> In fact the round_jiffies_up() routines were added for other users as
> well as the block layer.  However none of the others could be changed
> until the routines were merged.  Now that the routines are in the 
> mainline, you should see them start to be called in multiple places.
> 
> Also, the users of the block layer _don't_ care about exact timeouts.  
> That's an important aspect of round_jiffies() and round_jiffies_up() --
> you don't use them if you want an exact timeout.
> 
> The reason for using round_jiffies() is to insure that the timeout
> will occur at a 1-second boundary.  If several timeouts are set for
> about the same time and they all use round_jiffies() or
> round_jiffies_up(), then they will all occur at the same tick instead
> of spread out among several different ticks during the course of that
> 1-second interval.  As a result, the system will need to wake up only
> once to service all those timeouts, instead of waking up several
> different times.  It is a power-saving scheme.

I can't add anything else, can't say it any better either. The main
point of using round_jiffies_up() is to align with other timers. I don't
understand why you (Tomo) think that timeouts are exact? They really are
not, and within the same second is quite adequate here.

-- 
Jens Axboe


  reply	other threads:[~2008-11-11 19:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-01 16:54 Problems with the block-layer timeouts Alan Stern
2008-11-02 20:35 ` Mike Anderson
2008-11-03  8:52 ` Jens Axboe
2008-11-03 14:18   ` James Smart
2008-11-03 17:23     ` Jens Axboe
2008-11-03 15:59   ` Alan Stern
2008-11-03 16:39     ` Tejun Heo
2008-11-03 17:07       ` Alan Stern
2008-11-03 17:27       ` Jens Axboe
2008-11-04  3:01         ` Tejun Heo
2008-11-06  0:01   ` FUJITA Tomonori
2008-11-06  7:23     ` Jens Axboe
2008-11-07  4:05       ` FUJITA Tomonori
2008-11-07 11:24         ` Jens Axboe
2008-11-11  6:54           ` FUJITA Tomonori
2008-11-11 17:11             ` Alan Stern
2008-11-11 19:19               ` Jens Axboe [this message]
2008-11-12  2:08                 ` FUJITA Tomonori
2008-11-13 10:34                   ` Jens Axboe
2008-11-17  3:48                     ` FUJITA Tomonori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081111191936.GK26778@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox