All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockrwd@gmail.com>
To: "Gao, Yunpeng" <yunpeng.gao@intel.com>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: How to make kernel block layer generate bigger request in the request queue?
Date: Fri, 09 Apr 2010 17:54:38 -0600	[thread overview]
Message-ID: <4BBFBE3E.5070605@gmail.com> (raw)
In-Reply-To: <CE761E84DADF2947A4AF22FB8D97A4731CAF351C@shsmsx501.ccr.corp.intel.com>

On 04/09/2010 08:07 AM, Gao, Yunpeng wrote:
> Hi,
>
> I'm working on a block device driver (NAND flash driver with FTL layer) on 2.6.31 Kernel. And try to improve sequential read/write performance of the block driver.
>
> When I debug the driver, I found that the sector numbers of every r/w request in the request queue is always not bigger than 8. That means, for every r/w request, it only handle 512 * 8 = 4KB bytes at most. And I think the sequential r/w speed can be improved if the Linux block layer generates bigger size data (for example, 64KB) for every request in the request queue.
>
> To implement this, I have added some code as below (My hardware doesn't support scatter/gather, but can do 512KB DMA data transfer):
> 	...
> 	blk_queue_max_sectors(dev->queue, 1024);
> 	blk_queue_max_phys_segments(dev->queue, 128);
> 	blk_queue_max_hw_segments(dev->queue, 1);
> 	blk_queue_max_segment_size(dev->queue, 524288);
> 	...
> And also set NOOP as the default IO Scheduler (because the underlying 'block' device is NAND flash, not a real hard disk).
>
> But seems it doesn't work. The block layer still generate at most 8 sector r/w request in request queue even if I read/write 1GB data from/to the device with dd command.
>
> Did I miss something to make the block layer generate bigger size data for every request in the request queue?
> Below is part of my source code. Any comments are highly appreciated. Thank you in advance.

8 sectors is 4KB, that's the size of a page. If the pages that are being 
written are not physically contiguous that may be the best the block 
layer can do with the constraints you've given it (not supporting any 
more than 1 DMA segment). I don't think it will try to copy pages around 
in order to try and generate a bigger request.

  reply	other threads:[~2010-04-09 23:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 14:07 How to make kernel block layer generate bigger request in the request queue? Gao, Yunpeng
2010-04-09 23:54 ` Robert Hancock [this message]
2010-04-10  2:05   ` Martin K. Petersen
2010-04-10 14:58     ` James Bottomley
2010-04-12 18:26       ` Martin K. Petersen
2010-04-12 19:58         ` James Bottomley
2010-04-13 15:06           ` Gao, Yunpeng
2010-04-13 15:20             ` Alan Cox
2010-04-19  6:42               ` Gao, Yunpeng

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=4BBFBE3E.5070605@gmail.com \
    --to=hancockrwd@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=yunpeng.gao@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.