public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Vasquez <andrew.vasquez@qlogic.com>
To: Jeremy Higdon <jeremy@sgi.com>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [RFC PATCH 2.6.9-rc2] Add sysfs queue depth override to qla2xxx
Date: Wed, 29 Sep 2004 09:41:33 -0700	[thread overview]
Message-ID: <1096476093.10859.73.camel@praka> (raw)
In-Reply-To: <20040929003611.GK192475@sgi.com>

On Tue, 2004-09-28 at 17:36, Jeremy Higdon wrote:
> So do we have a consensus on what the driver should limit queue
> depth to?  Currently, it's 32 or ql2xmaxqdepth, if that was specified.
> From what I can see, ql2xmaxqdepth is effectively limited to 65535.
> 
> We don't want one lun to use host driver or host adapter resources
> to the point that it starves other luns.  Ideally, the max would
> depend on what else was attached, but I don't think we want to
> make this too complicated.

I agree.

>   Anyone changing the queue depth should
> have a clue about what they're doing.
> 
> Andrew, how many command slots are there in the various adapters,
> and do the continuation entries each eat a command slot?
> 

Well, determining that can be complicated...

The request-queue size is based on the amount of SRAM available to the
ISP.   For most HBAs (qla2100, qla2200, qla2300, qla2310, qla2342) which
have an 128KB memory chip (per-port), the 8.x driver will allocate
2048-entry queue for requests.  

Many new(-er) boards (qla235x, qla236x) and embedded implementations
(fibre-down) have a 512KB or 1MB chip.  Not wanting to digress into
another layer of firmware resource-usage details, let's just say that
the extra memory allows for the firmware to manage a larger number of
requests.  The driver in these cases will allocate a 4096-entry
request-queue.

Now depending on the sizeof(dma_addr_t)
(qla2x00_config_dma_addressing()) a single (scsi_cmnd) command with 32
sg entries (assuming 4KB page size,  transferring 128KB of data) will
consume:

    sizeof(dma_addr_t) == 4 (32bit):

	 1	command IOCB (3 data segments)
	 5	continuation IOCBs (7 data segments per IOCB)
		- only one entry within the last continuation IOCB used
	--
	 6	request entries

and 

    sizeof(dma_addr_t) == 8 (64bit):

	 1	command IOCB (2 data segments)
	 6	continuation IOCBs (5 data segments per IOCB)
	--
	 7	request entries

Extending the basic formula, to transfer X KBs of data, you'll consume:

	         32bit    64bit
	      -----------------
	256KB -     10       14
	512KB -     19       27   request entries

As an example, taking the 512KB transfer consuming 27 request entries,
having an 2048 request-queue depth will support the transfer of 75 
(2048 / 27) concurrent 512KB transfer requests; ~150 concurrent requests
with an 4096 request-queue depth.

Here's another small table showing total requests per request's size
with an 2048 request-queue depth (multiply by 2 for an 4096 depth):

	         32bit    64bit
	      -----------------
	128KB -    341      292
	256KB -    204      146
	512KB -    107       75   concurrent requests

I hope this answers your request-queue usage question.  

I'm not sure if it brings us any closer to answering the question of
'what's the max queue-depth we support?'  Is it even possible, since as
you mentioned earlier, the admin will have to possess some outside
knowledge (backend-storage, I/O type, I/O patterns) while tuning the
queue-depth value.

--
Andrew








aTypically you'll find 128KB of memory available to the ISP, in
thoseMost implementations tend the request-queue can be , typically
there is a 128KiB for each 

> jeremy


  reply	other threads:[~2004-09-29 16:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-28 16:52 [RFC PATCH 2.6.9-rc2] Add sysfs queue depth override to qla2xxx Andrew Vasquez
2004-09-28 19:36 ` Jeremy Higdon
2004-09-28 19:53   ` James Bottomley
2004-09-28 20:12     ` Jens Axboe
2004-09-28 20:34       ` Andrew Vasquez
2004-09-29  6:21         ` Jens Axboe
2004-09-29  6:57           ` Jeremy Higdon
2004-09-29  6:56             ` Jens Axboe
2004-09-29  0:36     ` Jeremy Higdon
2004-09-29 16:41       ` Andrew Vasquez [this message]
2004-09-29 22:12         ` Jeremy Higdon
  -- strict thread matches above, loose matches on Subject: below --
2004-09-28 16:54 Andrew Vasquez
2004-09-27  6:10 Jeremy Higdon
2004-09-27  6:25 ` Jeremy Higdon
2004-09-28  7:54 ` Jeremy Higdon
2004-09-28 14:05   ` James Bottomley

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=1096476093.10859.73.camel@praka \
    --to=andrew.vasquez@qlogic.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=jeremy@sgi.com \
    --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