mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Miquel van Smoorenburg <miquels@cistron.nl>
Cc: axboe@suse.de, miquels@cistron.nl, linux-lvm@sistina.com,
	linux-kernel@vger.kernel.org, thornber@redhat.com
Subject: Re: IO scheduler, queue depth, nr_requests
Date: Wed, 18 Feb 2004 17:26:22 -0800	[thread overview]
Message-ID: <20040218172622.52914567.akpm@osdl.org> (raw)
In-Reply-To: <20040218235243.GA30621@drinkel.cistron.nl>

Miquel van Smoorenburg <miquels@cistron.nl> wrote:
>
> On Tue, 17 Feb 2004 15:57:16, Miquel van Smoorenburg wrote:
> > For some reason, when using LVM, write requests get queued out
> > of order to the 3ware controller, which results in quite a bit
> > of seeking and thus performance loss.
> [..]
> > Okay I repeated some earlier tests, and I added some debug code in
> > several places.
> > 
> > I added logging to tw_scsi_queue() in the 3ware driver to log the
> > start sector and length of each request. It logs something like:
> > 3wdbg: id 119, lba = 0x2330bc33, num_sectors = 256
> > 
> > With a perl script, I can check if the requests are sent to the
> > host in order. That outputs something like this:
> > 
> > Consecutive: start 1180906348, length 7936 sec (3968 KB), requests: 31
> > Consecutive: start 1180906340, length 8 sec (4 KB), requests: 1
> > Consecutive: start 1180914292, length 7936 sec (3968 KB), requests: 31
> > Consecutive: start 1180914284, length 8 sec (4 KB), requests: 1
> > Consecutive: start 1180922236, length 7936 sec (3968 KB), requests: 31
> > Consecutive: start 1180922228, length 8 sec (4 KB), requests: 1
> > Consecutive: start 1180930180, length 7936 sec (3968 KB), requests: 31

3968 / 31 = 128 exactly.  I think when you say "requests: 31" you are
actually referring to a single request which has 31 128k BIOs in it, yes?

> > 
> > See, 31 requests in order, then one request "backwards", then 31 in order, etc.
> 
> I found out what causes this. It's get_request_wait().
> 
> When the request queue is full, and a new request needs to be created,
> __make_request() blocks in get_request_wait().
> 
> Another process wakes up first (pdflush / process submitting I/O itself /
> xfsdatad / etc) and sends the next bio's to __make_request().
> In the mean time some free requests have become available, and the bios
> are merged into a new request. Those requests are submitted to the device.
> 
> Then, get_request_wait() returns but the bio is not mergeable anymore -
> and that results in a backwards seek, severely limiting the I/O rate.
> 
> Wouldn't it be better to allow the request allocation and queue the
> request, and /then/ put the process to sleep ? The queue will grow larger
> than nr_requests, but it does that anyway.

That would help, but is a bit kludgy.

What _should_ have happened was:

a) The queue gets plugged

b) The maximal-sized 31-bio request is queued

c) The 4k request gets inserted *before* the 3968k request

d) The queue gets unplugged, and both requests stream smoothly.

(And this assumes that the queue was initially empty.  ALmost certainly
that was not the case).

So the question is, why did the little, later 4k request not get itself
inserted in front of the earlier, large 3968k request?

Are you using md as well?  If so, try removing the blk_run_queues()
statements from md_thread() and md_do_sync().  And generally hunt around
and try nuking blk_run_queues() statements from the device driver/md/dm
layer - they may well be wrong.

Is this problem specific to md?  Can it be reproduced on a boring-old-disk?

Does elevator=deadline change anything?



  parent reply	other threads:[~2004-02-19  1:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040216131609.GA21974@cistron.nl>
     [not found] ` <20040216133047.GA9330@suse.de>
     [not found]   ` <20040217145716.GE30438@traveler.cistron.net>
2004-02-18 23:52     ` Miquel van Smoorenburg
2004-02-19  1:24       ` Nick Piggin
2004-02-19  1:52         ` Miquel van Smoorenburg
2004-02-19  2:01           ` Nick Piggin
2004-02-19  1:26       ` Andrew Morton [this message]
2004-02-19  2:11         ` Miquel van Smoorenburg
2004-02-19  2:26           ` Andrew Morton
2004-02-19 10:15             ` Miquel van Smoorenburg
2004-02-19 10:19               ` Jens Axboe
2004-02-19 20:59                 ` Miquel van Smoorenburg
2004-02-19 22:52                   ` Nick Piggin
2004-02-19 23:53                     ` Miquel van Smoorenburg
2004-02-20  0:15                       ` Nick Piggin
2004-02-20  1:12                       ` [PATCH] per process request limits (was Re: IO scheduler, queue depth, nr_requests) Nick Piggin
2004-02-20  1:26                         ` Andrew Morton
2004-02-20  1:40                           ` Nick Piggin
2004-02-20  2:32                             ` Andrew Morton
2004-02-20 14:40                               ` [PATCH] bdi_congestion_funp (was: Re: [PATCH] per process request limits (was Re: IO scheduler, queue depth, nr_requests)) Miquel van Smoorenburg
2004-02-20 14:57                                 ` Jens Axboe
2004-02-20 14:59                                 ` Joe Thornber
2004-02-20 15:00                                   ` Jens Axboe
2004-02-22 14:02                                     ` Miquel van Smoorenburg
2004-02-22 19:55                                       ` Andrew Morton
2004-02-20  1:45                         ` [PATCH] per process request limits (was Re: IO scheduler, queue depth, nr_requests) Nick Piggin
2004-02-19  2:51           ` IO scheduler, queue depth, nr_requests Nick Piggin
2004-02-19 10:21             ` Jens Axboe
     [not found] <1qJVx-75K-15@gated-at.bofh.it>
     [not found] ` <1qJVx-75K-17@gated-at.bofh.it>
     [not found]   ` <1qJVw-75K-11@gated-at.bofh.it>
     [not found]     ` <1qLb8-6m-27@gated-at.bofh.it>
     [not found]       ` <1qLXl-XV-17@gated-at.bofh.it>
     [not found]         ` <1qMgF-1dA-5@gated-at.bofh.it>
     [not found]           ` <1qTs3-7A2-51@gated-at.bofh.it>
     [not found]             ` <1qTBB-7Hh-7@gated-at.bofh.it>
     [not found]               ` <1r3AS-1hW-5@gated-at.bofh.it>
     [not found]                 ` <1r5jD-2RQ-31@gated-at.bofh.it>
     [not found]                   ` <1r6fH-3L8-11@gated-at.bofh.it>
     [not found]                     ` <1r6S4-6cv-1@gated-at.bofh.it>
2004-02-25 20:17                       ` Bill Davidsen
2004-02-25 21:39                         ` Miquel van Smoorenburg
2004-02-26  0:39                         ` Nick Piggin

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=20040218172622.52914567.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-lvm@sistina.com \
    --cc=miquels@cistron.nl \
    --cc=thornber@redhat.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

all inboxes | Powered by JetHome®