Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1690331 > unrolled thread

Re: [PATCH] nvme: Acknowledge completion queue on each iteration

Started byKeith Busch <keith.busch@intel.com>
First post2017-07-18 16:40 +0200
Last post2017-07-18 23:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] nvme: Acknowledge completion queue on each iteration Keith Busch <keith.busch@intel.com> - 2017-07-18 16:40 +0200
    Re: [PATCH] nvme: Acknowledge completion queue on each iteration Sinan Kaya <okaya@codeaurora.org> - 2017-07-18 21:00 +0200
      Re: [PATCH] nvme: Acknowledge completion queue on each iteration Keith Busch <keith.busch@intel.com> - 2017-07-18 23:30 +0200

#1690331 — Re: [PATCH] nvme: Acknowledge completion queue on each iteration

FromKeith Busch <keith.busch@intel.com>
Date2017-07-18 16:40 +0200
SubjectRe: [PATCH] nvme: Acknowledge completion queue on each iteration
Message-ID<u4BPk-3zB-17@gated-at.bofh.it>
On Mon, Jul 17, 2017 at 07:07:00PM -0400, okaya@codeaurora.org wrote:
> Maybe, I need to understand the design better. I was curious why completion
> and submission queues were protected by a single lock causing lock
> contention.

Ideally the queues are tied to CPUs, so you couldn't have one thread
submitting to a particular queue-pair while another thread is reaping
completions from it. Such a setup wouldn't get lock contention.

Some machines have so many CPUs, though, that sharing hardware queues
is required. We've experimented with separate submission and completion
locks for such cases, but I've never seen an improved performance as a
result.

[toc] | [next] | [standalone]


#1690573

FromSinan Kaya <okaya@codeaurora.org>
Date2017-07-18 21:00 +0200
Message-ID<u4FSW-61V-25@gated-at.bofh.it>
In reply to#1690331
On 7/18/2017 10:36 AM, Keith Busch wrote:
> On Mon, Jul 17, 2017 at 07:07:00PM -0400, okaya@codeaurora.org wrote:
>> Maybe, I need to understand the design better. I was curious why completion
>> and submission queues were protected by a single lock causing lock
>> contention.
> Ideally the queues are tied to CPUs, so you couldn't have one thread
> submitting to a particular queue-pair while another thread is reaping
> completions from it. Such a setup wouldn't get lock contention.

I do see that the NVMe driver is creating a completion interrupt on
each CPU core for the completions. No problems with that. 

However, I don't think you can guarantee that there will always be a single
CPU core targeting one submission queue especially with asynchronous IO.

Lock contention counters from CONFIG_LOCK_STAT are pointing to nvmeq->lock
in my FIO tests.

Did I miss something?

> 
> Some machines have so many CPUs, though, that sharing hardware queues
> is required. We've experimented with separate submission and completion
> locks for such cases, but I've never seen an improved performance as a
> result.
> 

I have also experimented with multiple locks with no significant gains. 
However, I was curious if somebody else had a better implementation than mine.

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

[toc] | [prev] | [next] | [standalone]


#1690665

FromKeith Busch <keith.busch@intel.com>
Date2017-07-18 23:30 +0200
Message-ID<u4Ie5-7Cc-3@gated-at.bofh.it>
In reply to#1690573
On Tue, Jul 18, 2017 at 02:52:26PM -0400, Sinan Kaya wrote:
> On 7/18/2017 10:36 AM, Keith Busch wrote:
> 
> I do see that the NVMe driver is creating a completion interrupt on
> each CPU core for the completions. No problems with that. 
> 
> However, I don't think you can guarantee that there will always be a single
> CPU core targeting one submission queue especially with asynchronous IO.
>
> Lock contention counters from CONFIG_LOCK_STAT are pointing to nvmeq->lock
> in my FIO tests.
> 
> Did I miss something?

I think that must mean your machine has many more CPUs than your nvme
controller has IO queues.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web