linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Tejun Heo <htejun@gmail.com>, Alan Cox <alan@redhat.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: libata .sg_tablesize: why always dividing by 2 ?
Date: Mon, 25 Feb 2008 19:27:24 -0500	[thread overview]
Message-ID: <47C35CEC.5040301@rtr.ca> (raw)
In-Reply-To: <47C35A3B.8080604@pobox.com>

Jeff Garzik wrote:
> Mark Lord wrote:
>> Jeff,
>>
>> We had a discussion here today about IOMMUs,
>> and they *never* split sg list entries -- they only ever *merge*.
>>
>> And this happens only after the block layer has
>> already done merging while respecting q->seg_boundary_mask.
>>
>> So worst case, the IOMMU may merge everything, and then in
>> libata we unmerge them again.  But the end result can never
>> exceed the max_sg_entries limit enforced by the block layer.
> 
> <shrug>  Early experience said otherwise.  The split in foo_fill_sg() 
> and resulting sg_tablesize reduction were both needed to successfully 
> transfer data, when Ben H originally did the work.
> 
> If Ben H and everyone on the arch side agrees with the above analysis, I 
> would be quite happy to remove all those "/ 2".
> 
> 
>> This can cost a lot of memory, as using NCQ effectively multiplies
>> everything by 32..
> 
> I recommend dialing down the hyperbole a bit :)
> 
> "a lot" in this case is...  maybe another page or two per table, if 
> that.  Compared with everything else in the system going on, with 
> 16-byte S/G entries, S/G table size is really the least of our worries.
..

Well, today each sg table is about a page in size,
and sata_mv has 32 of them per port.
So cutting them in half would save 16 pages per port,
or 64 pages per host controller.

That's a lot for a small system, but maybe not for my 4GB test boxes.

> If you were truly concerned about memory usage in sata_mv, a more 
> effective route is simply reducing MV_MAX_SG_CT to a number closer to 
> the average s/g table size -- which is far, far lower than 256 
> (currently MV_MAX_SG_CT), or even 128 (MV_MAX_SG_CT/2).
> 
> Or moving to a scheme where you allocate (for example) S/G tables with 
> 32 entries... then allocate on the fly for the rare case where the S/G 
> table must be larger...
..

Oh, absolutely.. that's on my "clean up" list once the rest of
the driver becomes stable and mostly done.  But for now, "safety and correctness is far more paramount" in sata_mv.  :)

Cheers

  reply	other threads:[~2008-02-26  0:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26  0:02 libata .sg_tablesize: why always dividing by 2 ? Mark Lord
2008-02-26  0:15 ` Jeff Garzik
2008-02-26  0:27   ` Mark Lord [this message]
2008-02-26  0:54   ` Benjamin Herrenschmidt
2008-02-26  1:37     ` Mark Lord
2008-02-26  1:43       ` Mark Lord
2008-02-26  2:54         ` Benjamin Herrenschmidt
2008-02-26  4:38           ` Mark Lord
2008-02-26  5:30             ` Benjamin Herrenschmidt
2008-02-26  5:43               ` Mark Lord
2008-02-26  5:47                 ` Benjamin Herrenschmidt
2008-02-26 16:09                   ` James Bottomley
2008-02-26 21:43                     ` Benjamin Herrenschmidt
2008-02-26 16:25                   ` Mark Lord
2008-02-26 16:51                     ` Mark Lord
2008-02-26 21:50                       ` Benjamin Herrenschmidt
2008-02-26 21:56                         ` James Bottomley
2008-02-26 22:30                           ` Benjamin Herrenschmidt
2008-02-26 23:16                             ` Benjamin Herrenschmidt
2008-02-26 21:43                     ` Benjamin Herrenschmidt
2008-02-26 23:07                       ` Alan Cox
2008-02-26 23:19                         ` Benjamin Herrenschmidt
2008-02-28  7:36                           ` FUJITA Tomonori
2008-02-28  7:44                             ` Benjamin Herrenschmidt
2008-02-26  2:52       ` Benjamin Herrenschmidt
2008-02-26  0:22 ` Jeff Garzik
2008-02-26  0:28   ` Mark Lord

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=47C35CEC.5040301@rtr.ca \
    --to=liml@rtr.ca \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alan@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).