LKML Archive on
help / color / mirror / Atom feed
From: Christoph Lameter <>
To: "Siddha, Suresh B" <>
Subject: Re: [rfc] direct IO submission and completion scalability issues
Date: Mon, 30 Jul 2007 11:20:04 -0700 (PDT)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, 27 Jul 2007, Siddha, Suresh B wrote:

> We have been looking into the linux kernel direct IO scalability issues with
> database workloads. Comments and suggestions on our below experiments are
> welcome.

This was on an SMP system? These issues are much more pronounced on a NUMA 
system. There the locality of the device may be a prime issue.

> In the linux kernel, direct IO requests are not batched at the block layer.
> i.e, as a new request comes in, the request get directly submitted to the
> IO controller on the same cpu that the request originates. And the IO completion
> likely happens on a different cpu which is processing interrupts. This results
> in cacheline bouncing of some of the hot kernel cachelines (like timers, scsi
> cmds, slab, sched, etc) and is becoming an important scalability issue
> as the number of cpus and distance between them increase with multi-core
> and numa.

Yes. The issue is even worse if the submission comes from a remote node. 
F.e. If we have a system with a scsi controller on node 2. Now I/O 
submission on node 1 and completion on node 2. In that case the 
cacheline has to be transferred across the NUMA interlink.

However, you cannot avoid running the completion on the node where the 
device sits. The device has all sorts of control structures and if you 
would handle the completion on node 1 then it would have to transfer lots
of cachelines that contain device state to node 1.

I think it is better to leave things as is. Or have the I/O submission be 
relocated to the node of the device.
> Second experiment which we did was migrating the IO submission to the
> IO completion cpu. Instead of submitting the IO on the same cpu where the
> request arrived, in this experiment  the IO submission gets migrated to the
> cpu that is processing IO completions(interrupt). This will minimize the
> access to remote cachelines (that happens in timers, slab, scsi layers). The
> IO submission request is forwarded to the kblockd thread on the cpu receiving
> the interrupts. As part of this, we also made kblockd thread on each cpu as the
> highest priority thread, so that IO gets submitted as soon as possible on the
> interrupt cpu with out any delay. On x86_64 SMP platform with 16 cores, this
> resulted in 2% performance improvement and 3.3% improvement on two node ia64
> platform.

I think that is the right approach. This will also help in cases where I/O 
devices can only be accessed from a certain node (NUMA device address 
restrictions on some systems may not allow remote cacheline access!)

> Observation #2: This introduces some migration overhead during IO submission.
> With the current prototype, every incoming IO request results in an IPI and
> context switch(to kblockd thread) on the interrupt processing cpu.
> This issue needs to be addressed and main challenge to address is
> the efficient mechanism of doing this IO migration(how much batching to do and
> when to send the migrate request?), so that we don't delay the IO much and at
> the same point, don't cause much overhead during migration.


  reply	other threads:[~2007-07-30 18:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-28  1:21 Siddha, Suresh B
2007-07-30 18:20 ` Christoph Lameter [this message]
2007-07-30 20:35   ` Siddha, Suresh B
2007-07-31  4:19     ` Nick Piggin
2007-07-31 17:14       ` Siddha, Suresh B
2007-08-01  0:41         ` Nick Piggin
2007-08-01  0:55           ` Siddha, Suresh B
2007-08-01  1:24             ` Nick Piggin
2008-02-03  9:52 ` Nick Piggin
2008-02-03 10:53   ` Pekka Enberg
2008-02-03 11:58     ` Nick Piggin
2008-02-04  2:10   ` David Chinner
2008-02-04  4:14     ` Arjan van de Ven
2008-02-04  4:40       ` David Chinner
2008-02-04 10:09         ` Nick Piggin
2008-02-05  0:14           ` David Chinner
2008-02-08  7:50             ` Nick Piggin
2008-02-04 18:21     ` Zach Brown
2008-02-04 20:10       ` Jens Axboe
2008-02-04 21:45         ` Arjan van de Ven
2008-02-05  8:24           ` Jens Axboe
2008-02-04 10:12   ` Jens Axboe
2008-02-04 10:31     ` Nick Piggin
2008-02-04 10:33       ` Jens Axboe
2008-02-04 22:28         ` James Bottomley
2008-02-04 10:30   ` Andi Kleen
2008-02-04 21:47   ` Siddha, Suresh B

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [rfc] direct IO submission and completion scalability issues' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).