linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Adrian McMenamin <lkmladrian@gmail.com>
Cc: linux-ide@vger.kernel.org, Mark Lord <liml@rtr.ca>
Subject: Re: Best way to segments/requests
Date: Sat, 15 Dec 2007 00:05:03 +0900	[thread overview]
Message-ID: <47629B9F.90108@gmail.com> (raw)
In-Reply-To: <8b67d60712131459q35c3ef0dpe1347028112343fd@mail.gmail.com>

Hello,

Adrian McMenamin wrote:
> I am working on a driver for the CD Rom drive on the Sega Dreamcast
> (the so-called "GD Rom" drive). This device is electorically
> compatible with IDE-3 devices and has a pretty good match in terms of
> the control block registers but it implements its own packet command
> interface.
> 
> I now have a working driver but the performance is lousy.
> 
> The driver reads data off the disk using DMA and the target for the
> DMA has to be a contiguous. Therefore I have set:
> 
> 	/* using DMA so memory will need to be contiguous */
> 	blk_queue_max_hw_segments(gd.gdrom_rq, 1);
> 	/* set a large max size to get most from DMA */
> 	blk_queue_max_segment_size(gd.gdrom_rq, 0x40000);

Ah...

> ie only one segment per request but a big (for a small device) maximum
> size for the segment.
> 
> A priori I can see no performance advantage in allowing each request
> to include multiple segments because then I'd only have to reshake
> them so they went in one at a time. But from the looks of it if I do
> set the maximum number of segments to 1 then each request is limited
> to the smallest size - ie what I set in blk_queue_hardsect_size.

There just isn't much room for maneuver w/ just one segment.  Large
contiguous memory region isn't too common these days.  That said, there
was a bug recently spotted by Mark Lord which made contiguous memory
regions even rarer.  Which kernel version are you using?

> Is that right? What is the best way to go here?

If you can spare some memory and cpu cycles, preparing a contiguous
buffer and staging data there might help.  It will eat up some cpu
cycles but it won't be too much compared to PIO cycles.

-- 
tejun

  reply	other threads:[~2007-12-14 15:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-13 22:59 Best way to segments/requests Adrian McMenamin
2007-12-14 15:05 ` Tejun Heo [this message]
2007-12-14 15:22   ` Adrian McMenamin
2007-12-14 15:34     ` 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=47629B9F.90108@gmail.com \
    --to=htejun@gmail.com \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=lkmladrian@gmail.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).