public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: Nick Piggin <nickpiggin@yahoo.com.au>, akpm@osdl.org
Subject: [PATCH] 4/4 block: explicit plugging
Date: Wed, 3 Jan 2007 10:41:59 +0100	[thread overview]
Message-ID: <20070103094159.GN11203@kernel.dk> (raw)
In-Reply-To: <11678105083001-git-send-email-jens.axboe@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 2653 bytes --]


Not much luck with the 4th patch, I guess it's too big. I've gzip
attached it now, with the description inlined.

---

Nick writes:

This is a patch to perform block device plugging explicitly in the submitting
process context rather than implicitly by the block device.

There are several advantages to plugging in process context over plugging
by the block device:

- Implicit plugging is only active when the queue empties, so any
  advantages are lost if there is parallel IO occuring. Not so with
  explicit plugging.

- Implicit plugging relies on a timer and watermarks and a kind-of-explicit
  directive in lock_page which directs plugging. These are heuristics and
  can cost performance due to holding a block device idle longer than it
  should be. Explicit plugging avoids most of these issues by only holding
  the device idle when it is known more requests will be submitted.

- This lock_page directive uses a roundabout way to attempt to minimise
  intrusiveness of plugging on the VM. In doing so, it gets needlessly
  complex: the VM really is in a good position to direct the block layer
  as to the nature of its requests, so there is no need to try to hide
  the fact.

- Explicit plugging keeps a process-private queue of requests being held.
  This offers some advantages over immediately sending requests to the
  block device: firstly, merging can be attempted on requests in this list
  (currently only attempted on the head of the list) without taking any
  locks; secondly, when unplugging occurs, the requests can be delivered
  to the block device queue in a batch, thus the lock aquisitions can be
  batched up.

On a parallel tiobench benchmark, of the 800 000 calls to __make_request
performed, this patch avoids 490 000 (62%) of queue_lock aquisitions by
early merging on the private plugged list.

Signed-off-by: Nick Piggin <npiggin@suse.de>

Changes so far by me:

- Don't invoke ->request_fn() in blk_queue_invalidate_tags

- Fixup all filesystems for block_sync_page()

- Add blk_delay_queue() to handle the old plugging-on-shortage usage.

- Unconditionally run replug_current_nested() in ioschedule()

- Fixup queue start/stop

- Fixup all the remaining drivers

- Change the namespace (prefix the plug functions with blk_)

- Fixup ext4

- Dead code removal

- Fixup blktrace plug/unplug notifications

- __make_request() cleanups

- bio_sync() fixups

- Kill queue empty checking

- Make barriers work again, using QRCU

- Make blk_sync_queue() work again, reuse barrier SRCU handling

This patch needs more work and some dedicated testing.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

-- 
Jens Axboe


[-- Attachment #2: 0004-block-explicit-plugging.txt.gz --]
[-- Type: application/x-gzip, Size: 30605 bytes --]

      parent reply	other threads:[~2007-01-03  9:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-03  7:48 [BLOCK] 0/4 explicit io plugging Jens Axboe
2007-01-03  7:48 ` [PATCH] 1/4 qrcu: "quick" srcu implementation Jens Axboe
2007-01-03  7:48 ` [PATCH] 2/4 qrcu: add rcutorture test Jens Axboe
     [not found] ` <1167810508576-git-send-email-jens.axboe@oracle.com>
2007-01-03  8:09   ` [PATCH] 4/4 block: explicit plugging Andrew Morton
2007-01-03  8:22     ` Jens Axboe
2007-01-03 21:50       ` Chen, Kenneth W
2007-01-03 22:29         ` Jens Axboe
2007-01-03 22:34           ` Chen, Kenneth W
2007-01-04 14:39             ` Jens Axboe
2007-01-05 22:04               ` Chen, Kenneth W
2007-01-04  4:35   ` Nick Piggin
2007-01-05  7:23     ` Jens Axboe
2007-01-03  8:31 ` [PATCH] 3/4 qrcu: add documentation Jens Axboe
2007-01-03  9:29   ` Tomas Carnecky
2007-01-03  9:39     ` Jens Axboe
2007-01-03  9:41 ` Jens Axboe [this message]

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=20070103094159.GN11203@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /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