Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: m.mizuma@jp.fujitsu.com (Masayoshi Mizuma)
Subject: [PATCH] nvme: add a module parameter to change queue depth
Date: Tue, 5 Jul 2016 17:09:36 +0900	[thread overview]
Message-ID: <577B6B40.2010600@jp.fujitsu.com> (raw)
In-Reply-To: <20160704084940.GA7777@infradead.org>

  
On Mon, 4 Jul 2016 01:49:40 -0700 Christoph Hellwig wrote:
> On Mon, Jul 04, 2016@05:33:20PM +0900, Masayoshi Mizuma wrote:
>> This patch adds "q_depth_limit" as a module parameter. nvme_queue->q_depth
>> is set below q_depth_limit.
>>
>> while loop at __nvme_process_cq() sometimes takes long time and
>> the loop is under IRQ context, so system slow down and hardlockup
>> may occur because of the loop.
>>
>> The while loop runs nvme_queue->q_depth times and the q_depth is set
>> by the following (NVME_Q_DEPTH is 1024).
>>
>>   dev->q_depth = min_t(int, NVME_CAP_MQES(cap) + 1, NVME_Q_DEPTH);
>>
>> To reduce the times of the loop, the q_depth_limit is useful.
>>
>> In addition, this patch moves the temporary fix for the Apple controller
>> into the new function, get_q_depth().
>
> While limiting the queue depth might still be useful I think we need
> to look into a potential lock break in __nvme_process_cq so that it
> doesn't cause hard lockups even with large queue depth first.

Yes, the module parameter is useful as a workaround to avoid hard lockup.

I agree that we should look into nvme_queue->q_lock lock break
in __nvme_process_cq().

However, if __nvme_process_cq() is called by nvme_irq() in IRQ context,
the hard lockup may happen even if nvme_queue->q_lock is unlocked.
This is because timer interrupt is disabled while the IRQ context.

- Masayoshi Mizuma

>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
>

      reply	other threads:[~2016-07-05  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04  8:33 [PATCH] nvme: add a module parameter to change queue depth Masayoshi Mizuma
2016-07-04  8:49 ` Christoph Hellwig
2016-07-05  8:09   ` Masayoshi Mizuma [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=577B6B40.2010600@jp.fujitsu.com \
    --to=m.mizuma@jp.fujitsu.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