linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Matthew Jacob <mjacob@feral.com>
Cc: "Justin T. Gibbs" <gibbs@scsiguy.com>,
	"Pedro M. Rodrigues" <pmanuel@myrealbox.com>,
	Mathieu Chouquet-Stringer <mathieu@newview.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Warning - running *really* short on DMA buffers while doing file transfers
Date: Fri, 27 Sep 2002 12:25:03 +0200	[thread overview]
Message-ID: <20020927102503.GA15101@suse.de> (raw)
In-Reply-To: <Pine.BSF.4.21.0209270055290.18408-100000@beppo>

On Fri, Sep 27 2002, Matthew Jacob wrote:
> > > I'd just suggest that it's asinine to criticise an HBA for running up to
> > > reasonable limits when it's the non-toy OS that will do sensible I/O
> > > scheduling. So point your gums elsewhere.
> > 
> > Well I don't think 253 is a reasonable limit, that was the whole point.
> > How can sane io scheduling ever prevent starvation in that case? I can't
> > point my gums elsewhere, this is where I'm seeing starvation.
> 
> You're in starvation because the I/O midlayer and buffer cache are
> allowing you to build enough transactions on one bus to impact system
> response times. This is an old problem with Linux that comes and goes

That's one type of starvation, but that's one that can be easily
prevented by the os. Not a problem.

The starvation I'm talking about is the drive starving requests. Just
keep it moderately busy (10-30 outstanding tags), and a read can take a
long time to complete. The hba can try to prevent this from happening by
issuing ever Xth request as on ordered tag, however the fact that we
even need to consider doing this suggests to me that something is
broken. That a drive can starve a single request for that long is _bad_.
Issuing every 1024th request as ordered helps absolutely zip for good
interactive behaviour. It might help on a single request basis, but good
latency feel typically requires more than that.

We _can_ try and prevent this type of starvation. If we encounter a
read, don't queue any more writes to the drive before it completes.
That's some simple logic that will probably help a lot. This is the type
of thing the deadline io scheduler tries to do. This is working around
broken drive firmware in my oppinion, the drive shouldn't be starving
requests like that.

However, it's stupid to try and work around a problem if we can simply
prevent the problem in the first place. What is the problem? It's lots
of tags causing the drive to starve requests. Do we need lots of tags?
In my experience 4 tags is more than plenty for a typical drive, there's
simply _no_ benefit from going beyond that. It doesn't buy you extra
throughput, it doesn't buy you better io scheduling (au contraire). All
it gets you is lots of extra latency. So why would I want lots of tags
on a typical scsi drive? I don't.

> (as it has come and gone for most systems). There are a number of
> possible solutions to this problem- but because this is in 2.4 perhaps
> the most sensible one is to limit how much you *ask* from an HBA,
> perhaps based upon even as vague a set of parameters as CPU speed and
> available memory divided by the number of <n-scsibus/total spindles).

This doesn't make much sense to me. Why would the CPU speed and
available memory impact this at all? We don't want to deplete system
resources (the case Justin mentioned), of course, but beyond that I
don't think it makes much sense.

> It's the job of the HBA driver to manage resources on the the HBA and on
> the bus the HBA interfaces to. If the HBA and its driver can efficiently
> manage 1000 concurrent commands per lun and 16384 luns per target and
> 500 'targets' in a fabric, let it.

Yes, if the hba and its drive _and_ the target can _efficiently_ handle
it, I'm all for it. Again you seem to be comparing the typical scsi hard
drive to more esoteric devices. I'll note again that I'm not talking
about such devices.

> Let oversaturation of a *spindle* be informed by device quirks and the
> rate of QFULLs received, or even, if you will, by finding the knee in

If device quirks are that 90% (pulling this number out of my ass) of
scsi drives use pure internal sptf scheduling and thus heavily starve
requests, then why bother? Queue full contains no latency information.

> the per-command latency curve (if you can and you think that it's

I can try to get a decent default. 253 clearly isn't it, far from it.

> meaningful). Let oversaturation of the system be done elsewhere- let the
> buffer cache manager and system policy knobs decide whether the fact
> that the AIC driver is so busy moving I/O that the user can't get window
> focus onto the window in N-P complete time to kill the runaway tar.

This is not a problem with the vm flooding a spindle. We want it to be
flooded, the more we can shove into the io scheduler to work with, the
better chance it has of doing a good job.

> Sorry- an overlong response. It *is* easier to just say "well, 'fix' the
> HBA driver so it doesn't allow the system to get too busy or
> overloaded". But it seems to me that this is even best solved in the
> midlayer which should, in fact, know best (better than a single HBA).

Agrh. Who's saying 'fix' the hba driver? Either I'm not expressing
myself very clearly, or you are simply not reading what I write.

-- 
Jens Axboe


  reply	other threads:[~2002-09-27 10:20 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-26  3:27 Warning - running *really* short on DMA buffers while doing file transfers Mathieu Chouquet-Stringer
2002-09-26  6:14 ` Jens Axboe
2002-09-26  7:04   ` Pedro M. Rodrigues
2002-09-26 15:31     ` Justin T. Gibbs
2002-09-27  6:13       ` Jens Axboe
2002-09-27  6:33         ` Matthew Jacob
2002-09-27  6:36           ` Jens Axboe
2002-09-27  6:50             ` Matthew Jacob
2002-09-27  6:56               ` Jens Axboe
2002-09-27  7:18                 ` Matthew Jacob
2002-09-27  7:24                   ` Jens Axboe
2002-09-27  7:29                     ` Matthew Jacob
2002-09-27  7:34                       ` Matthew Jacob
2002-09-27  7:45                         ` Jens Axboe
2002-09-27  8:37                           ` Matthew Jacob
2002-09-27 10:25                             ` Jens Axboe [this message]
2002-09-27 12:18                               ` Matthew Jacob
2002-09-27 12:54                                 ` Jens Axboe
2002-09-27 13:30                               ` Justin T. Gibbs
2002-09-27 14:26                                 ` James Bottomley
2002-09-27 14:33                                   ` Jens Axboe
2002-09-27 16:26                                   ` Justin T. Gibbs
2002-09-27 17:21                                     ` James Bottomley
2002-09-27 18:56                                       ` Justin T. Gibbs
2002-09-27 19:07                                         ` Warning - running *really* short on DMA buffers while doingfile transfers Andrew Morton
2002-09-27 19:16                                           ` Justin T. Gibbs
2002-09-27 19:36                                             ` Warning - running *really* short on DMA buffers while doingfiletransfers Andrew Morton
2002-09-27 19:52                                               ` Justin T. Gibbs
2002-09-27 21:13                                                 ` James Bottomley
2002-09-27 21:18                                                   ` Matthew Jacob
2002-09-27 21:23                                                     ` James Bottomley
2002-09-27 21:29                                                       ` Justin T. Gibbs
2002-09-27 21:32                                                       ` Matthew Jacob
2002-09-27 22:08                                                       ` Mike Anderson
2002-09-30 23:49                                                       ` Doug Ledford
2002-09-27 21:28                                                   ` Justin T. Gibbs
2002-09-28 15:52                                                     ` James Bottomley
2002-09-28 23:25                                                       ` Luben Tuikov
2002-09-29  2:48                                                         ` James Bottomley
2002-09-30  8:34                                                         ` Jens Axboe
2002-09-29  4:00                                                       ` Justin T. Gibbs
2002-09-29 15:45                                                         ` James Bottomley
2002-09-29 16:49                                                           ` [ getting OT ] " Matthew Jacob
2002-09-30 19:06                                                           ` Luben Tuikov
2002-09-30 23:54                                                     ` Doug Ledford
2002-09-27 19:58                                               ` Andrew Morton
2002-09-27 20:58                                       ` Warning - running *really* short on DMA buffers while doing file transfers Justin T. Gibbs
2002-09-27 21:38                                         ` Patrick Mansfield
2002-09-27 22:08                                           ` Justin T. Gibbs
2002-09-27 22:28                                             ` Patrick Mansfield
2002-09-27 22:48                                               ` Justin T. Gibbs
2002-09-27 18:59                                     ` Warning - running *really* short on DMA buffers while doingfile transfers Andrew Morton
2002-09-27 14:30                                 ` Warning - running *really* short on DMA buffers while doing file transfers Jens Axboe
2002-09-27 17:19                                   ` Justin T. Gibbs
2002-09-27 18:29                                     ` Rik van Riel
2002-09-27 14:56                                 ` Rik van Riel
2002-09-27 15:34                                 ` Matthew Jacob
2002-09-27 15:37                                   ` Jens Axboe
2002-09-27 17:20                                     ` Justin T. Gibbs
2002-09-27 12:28       ` Pedro M. Rodrigues

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=20020927102503.GA15101@suse.de \
    --to=axboe@suse.de \
    --cc=gibbs@scsiguy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mathieu@newview.com \
    --cc=mjacob@feral.com \
    --cc=pmanuel@myrealbox.com \
    /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;
as well as URLs for NNTP newsgroup(s).