From: Jens Axboe <axboe@fb.com>
To: Keith Busch <keith.busch@intel.com>
Cc: "Matias Bjørling" <m@bjorling.me>,
"Matthew Wilcox" <willy@linux.intel.com>,
"sbradshaw@micron.com" <sbradshaw@micron.com>,
"tom.leiming@gmail.com" <tom.leiming@gmail.com>,
"hch@infradead.org" <hch@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH v7] NVMe: conversion to blk-mq
Date: Fri, 13 Jun 2014 13:29:40 -0600 [thread overview]
Message-ID: <539B5124.3090302@fb.com> (raw)
In-Reply-To: <alpine.LRH.2.03.1406131307330.4699@AMR>
On 06/13/2014 01:22 PM, Keith Busch wrote:
> On Fri, 13 Jun 2014, Jens Axboe wrote:
>> OK, same setup as mine. The affinity hint is really screwing us over, no
>> question about it. We just need a:
>>
>> irq_set_affinity_hint(dev->entry[nvmeq->cq_vector].vector,
>> hctx->cpumask);
>>
>> in the ->init_hctx() methods to fix that up.
>>
>> That brings us to roughly the same performance, except for the cases
>> where the dd is run on the thread sibling of the core handling the
>> interrupt. And granted, with the 16 queues used, that'll happen on
>> blk-mq. But since you have 32 threads and just 31 IO queues, the non
>> blk-mq driver must end up sharing for some cases, too.
>>
>> So what do we care most about here? Consistency, or using all queues at
>> all costs?
>
> I think we want to use all h/w queues regardless of mismatched sharing. A
> 24 thread server shouldn't use more of the hardware than a 32.
>
> You're right, the current driver shares the queues on anything with 32
> or more cpus with this NVMe controller, but we wrote an algorithm that
> allocates the most and tries to group them with their nearest neighbors.
>
> One performance oddity we observe is that servicing the interrupt on the
> thread sibling of the core that submitted the I/O is the worst performing
> cpu you can chose; it's actually better to use a different core on the
> same node. At least that's true as long as you're not utilizing the cpus
> for other work, so YMMV.
I played around with the mappings, and stumbled upon some pretty ugly
results. The back story is that on this test box, I limit max C state to
C1 to avoid having too much of a bad time with power management. Running
the dd on a specific core, yields somewhere around 52MB/sec for me.
That's with the right CPU affinity for the irq. If I purposely put it
somewhere else, I end up at 380-390MB/sec. Or if I leave it on the right
CPU but simply do:
perf record -o /dev/null dd if= ...
and run the same thing just traced, I get the high performance as well.
Indeed... So I went to take a look at what is going on. For the slow
case, turbostat tells me I'm spending 80% in C1. For the fast case,
we're down to 20% in C1.
I then turn off C1, but low and behold, it's still slow and sucky even
if turbostat now verifies that it's spending 0% time in C1.
Now, this smells like scheduling artifacts. I'm going to turn off all
power junk and see what happens. Because at 8x differences between fast
and slow, irq mappings don't really matter at all here. In fact it shows
results contrary to what you'd like to see.
next prev parent reply other threads:[~2014-06-13 19:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 9:20 [PATCH v7] conversion to blk-mq Matias Bjørling
2014-06-10 9:20 ` [PATCH v7] NVMe: " Matias Bjørling
2014-06-10 15:51 ` Keith Busch
2014-06-10 16:19 ` Jens Axboe
2014-06-10 19:29 ` Keith Busch
2014-06-10 19:58 ` Jens Axboe
2014-06-10 21:10 ` Keith Busch
2014-06-10 21:14 ` Jens Axboe
2014-06-10 21:21 ` Keith Busch
2014-06-10 21:33 ` Matthew Wilcox
2014-06-11 16:54 ` Jens Axboe
2014-06-11 17:09 ` Matthew Wilcox
2014-06-11 22:22 ` Matias Bjørling
2014-06-11 22:51 ` Keith Busch
2014-06-12 14:32 ` Matias Bjørling
2014-06-12 16:24 ` Keith Busch
2014-06-13 0:06 ` Keith Busch
2014-06-13 14:07 ` Jens Axboe
2014-06-13 15:05 ` Keith Busch
2014-06-13 15:11 ` Jens Axboe
2014-06-13 15:16 ` Keith Busch
2014-06-13 18:14 ` Jens Axboe
2014-06-13 19:22 ` Keith Busch
2014-06-13 19:29 ` Jens Axboe [this message]
2014-06-13 20:56 ` Jens Axboe
2014-06-13 21:28 ` Jens Axboe
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=539B5124.3090302@fb.com \
--to=axboe@fb.com \
--cc=hch@infradead.org \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=m@bjorling.me \
--cc=sbradshaw@micron.com \
--cc=tom.leiming@gmail.com \
--cc=willy@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox