linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Justin T. Gibbs" <gibbs@scsiguy.com>
To: James Bottomley <James.Bottomley@steeleye.com>
Cc: Jens Axboe <axboe@suse.de>, Matthew Jacob <mjacob@feral.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:56:59 -0600	[thread overview]
Message-ID: <2543856224.1033153019@aslan.btc.adaptec.com> (raw)
In-Reply-To: <200209271721.g8RHLTn05231@localhost.localdomain>

> Well, lets assume the simplest setup possible: select + tag msg + 10 byte 
> command + disconnect + reselect + status; that's 17 bytes async.  The
> maximum  bus speed async narrow is about 4Mb/s, so those 17 bytes take
> around 4us to  transmit.  On a wide Ultra2 bus, the data rate is about
> 80Mb/s so it takes  50us to transmit 4k or 800us to transmit 64k.
> However, the major killer in  this model is going to be disconnection
> delay at around 200us (dwarfing  arbitration delay, bus settle time etc).
> For 4k packets you spend about 3  times longer arbitrating for the bus
> than you do transmitting data.  For 64k  packets it's 25% of your data
> transmit time in arbitration.  Your theoretical  throughput for 4k
> packets is thus 20Mb/s.  In my book that's a significant  loss on an
> 80Mb/s bus.

This only matters if your benchmark is dependent on round-trip latency
(no read-ahead or write behind and no command overlap) or if you have
saturated the bus.  None of these are the case with the single drive
I/O benchmarks that have been talked about in this thread.  I suppose
I should have been more specific in saying, "the command overhead is
not a factor in the issues raised by this thread".  Now if you want
to use command overhead as a reason to use tagged queuing to mitigate
that overhead, by all means, go right ahead.

>> Hooks for sending ordered tags have been in the aic7xxx driver, at
>> least in FreeBSD's version, since '97.  As soon as the Linux cmd
>> blocks have such information it will be trivial to have the aic7xxx
>> driver issue the appropriate tag types.
> 
> They already do in 2.5, see scsi_populate_tag_msg() in scsi.h.  This
> assumes  you're using the generic tag queueing, which the aic7xxx
> doesn't, but you  could easily key the tag type off REQ_BARRIER.

Okay.

>> But this misses the point.  Andrew's original speculation was that
>> writes were "passing reads" once the read was submitted to the drive.
> 
> The speculation is based on the observation that for transactions
> consisting  of multiple writes and small reads, the reads take a long
> time to complete.

I've seen evidence that a series of reads takes a long time to complete,
but nothing that indicates that every read is starved beyond what you
would expect to see if a huge number of writes were issued between each
read.

> That translates to starving a read in favour of a
> bunch of contiguous writes.   I'm sure we've all seen SCSI drives indulge
> in this type of unfair behaviour  (it does make sense to keep servicing
> writes if they're direct follow on's  from the previously serviced ones).

Actually I haven't.  The closest I can come to this is a single read way
off on the far side of the disk starved by a continuous stream or reads
on the other side of the platter.  This behavior was fixed by all major
drive manufacturers that I know of back in 97 or 98.

>> I would like to understand the evidence behind that assertion since
>> all drive's I've worked with automatically give a higher priority to
>> read traffic than writes since writes can be buffered but reads
>> cannot.
> 
> The evidence is here:
> 
> http://marc.theaimsgroup.com/?l=linux-kernel&m=103302456113997&w=1

Which unfortunately characterizes only a single symptom without breaking
it down on a transaction by transaction basis.  We need to understand
how many writes were queued by the OS to the drive between each read to
know if the drive is actually allowing writes to pass reads or not.

--
Justin

  reply	other threads:[~2002-09-27 18:52 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
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 [this message]
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=2543856224.1033153019@aslan.btc.adaptec.com \
    --to=gibbs@scsiguy.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=axboe@suse.de \
    --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).