public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: Kurt Garloff <garloff@suse.de>,
	Linux SCSI list <linux-scsi@vger.kernel.org>,
	James Bottomley <James.Bottomley@steeleye.com>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: PATCH 5/5: scsi-scan-inq-timeout
Date: Wed, 21 Apr 2004 16:49:32 -0700	[thread overview]
Message-ID: <20040421164932.A21741@beaverton.ibm.com> (raw)
In-Reply-To: <20040421224843.GD643@tpkurt.garloff.de>; from garloff@suse.de on Thu, Apr 22, 2004 at 12:48:43AM +0200

On Thu, Apr 22, 2004 at 12:48:43AM +0200, Kurt Garloff wrote:
> Hi Patrick,
> 
> On Wed, Apr 21, 2004 at 01:24:54PM -0700, Patrick Mansfield wrote:
> > SCSI_TIMEOUT is 2 * HZ.
> > 
> > So we defaulted to 6 seconds, and now we default to 5.5 seconds. Why?
> 
> True.
> 
> I have added half a second to be safe against 0.
> Thus, I had the choice of rounding 6 to 6.5 or 5.5.
> I chose 5.5, because the old value was chosen very conservative, as it
> had to be enough for even sick devices. Now we have a boot parameter
> to accomodate these, thus we can be less conservative. Thus 5.5.

I have no idea why 6 seconds was picked, but it has been there for so
long, it should remain as the default. If a user picks 0, then too bad.
(It would be nice if there was some module_param with a range, so it could
never be set to 0, it looks like there is stuff in place for adding your
own types and your own "check" macro.)

> > Why not get rid of the HZ/2, and set scsi_inq_timeout = SCSI_TIMEOUT/HZ +
> > 4 so we default to 6 again?
> > 
> > So if a device needs at least N + .5 seconds then just set the
> > scsi_inq_timeout to N + 1.
> 
> Why do you dislike HZ/2. The number is computed by the compiler at
> compile time ...

It's not the HZ/2 I dislike, just the adjustment of the timeout value.

> > >  	SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: 1st INQUIRY %s with"
> > >  			" code 0x%x\n", sreq->sr_result ?
> > > @@ -393,7 +400,7 @@ static void scsi_probe_lun(struct scsi_r
> > >  		memset(inq_result, 0, possible_inq_resp_len);
> > >  		scsi_wait_req(sreq, (void *) scsi_cmd,
> > >  			      (void *) inq_result,
> > > -			      possible_inq_resp_len, SCSI_TIMEOUT + 4 * HZ, 3);
> > > +			      possible_inq_resp_len, (1+scsi_inq_timeout)*(HZ/2), 3);
> > 
> > IMO just make the two timeouts the same and avoid any potential problems
> > (like some funky device always takes 4 seconds to reponsd to an INQUIRY).
> 
> It's really only the reset recivery time which makes us choose such long
> times. Otherwise SCSI_TIMEOUT would be _plenty_ of time to answer an 
> INQUIRY. An INQUIRY is easier: No medium access is needed, see SPC3.
> When this second INQUIRY is done, a first one has succeeded already, so 
> the recovery from the reset has happened already.

> Anyway, if you dislike it, I don't care much. If the first INQUIRY
> succeeded, it's very unlikely that the second one fails, so the timeout
> is even less important in real life.

It should be plenty of time, but you can't guarantee it, so it's better to
be cautious and just use the same timeout.

-- Patrick Mansfield

  reply	other threads:[~2004-04-21 23:49 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-18 18:57 Patches for SCSI scanning Kurt Garloff
2004-04-18 23:16 ` James Bottomley
2004-04-20 11:54   ` Kurt Garloff
2004-04-20 12:04     ` Christoph Hellwig
2004-04-20 13:02       ` Kurt Garloff
2004-04-20 14:38     ` James Bottomley
2004-04-20 16:03       ` Kurt Garloff
2004-04-20 16:08         ` James Bottomley
2004-04-21 13:48           ` Kurt Garloff
2004-04-21 15:36             ` James Bottomley
2004-04-21 13:45         ` Kurt Garloff
2004-04-21 14:10           ` PATCH 1/5: scsi-scan-deprecate-forcelun Kurt Garloff
2004-04-21 14:12           ` PATCH 2/5: scsi-scan-blist_replun Kurt Garloff
2004-04-21 15:14             ` Christoph Hellwig
2004-04-21 15:30               ` Kurt Garloff
2004-04-21 16:03               ` Kurt Garloff
2004-04-21 14:13           ` PATCH 3/5: scsi-scan-no-offl-pq-notcon Kurt Garloff
2004-04-21 14:14           ` PATCH 4/5: scsi-scan-dont-att-pq-notcon Kurt Garloff
2004-04-21 15:02             ` Christoph Hellwig
2004-04-21 15:24               ` Kurt Garloff
2004-04-21 15:33                 ` Mike Anderson
2004-04-21 15:33                 ` Christoph Hellwig
2004-04-21 16:08                   ` Kurt Garloff
2004-04-21 16:18                     ` James Bottomley
2004-04-21 16:55                       ` Patrick Mansfield
2004-04-21 22:51                         ` Kurt Garloff
2004-04-22 20:39                           ` Patrick Mansfield
2004-04-22 20:45                             ` James Bottomley
2004-04-21 16:58                       ` Kurt Garloff
2004-04-21 16:16                   ` Kurt Garloff
2004-04-21 15:40             ` James Bottomley
2004-04-21 14:14           ` PATCH 5/5: scsi-scan-inq-timeout Kurt Garloff
2004-04-21 20:24             ` Patrick Mansfield
2004-04-21 22:48               ` Kurt Garloff
2004-04-21 23:49                 ` Patrick Mansfield [this message]
2004-04-20 16:26       ` Patches for SCSI scanning Patrick Mansfield
2004-04-20 16:42         ` Kurt Garloff
2004-04-20 17:44           ` Patrick Mansfield
2004-04-21 13:52             ` Kurt Garloff
2004-04-20 10:24 ` Fabien Salvi

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=20040421164932.A21741@beaverton.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=garloff@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    /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