From: willy@linux.intel.com (Matthew Wilcox)
Subject: [PATCH] NVMe: Do not set IO queue depth beyond device max
Date: Fri, 27 Jul 2012 14:00:59 -0400 [thread overview]
Message-ID: <20120727180059.GL22985@linux.intel.com> (raw)
In-Reply-To: <1343403244-21334-1-git-send-email-keith.busch@intel.com>
On Fri, Jul 27, 2012@09:34:04AM -0600, Keith Busch wrote:
> Set the depth for IO queues to the device's maximum supported queue
> entries if the requested depth exceeds the device's capabilities.
Thanks, applied with a couple of fixups.
> struct device *dmadev = &dev->pci_dev->dev;
> - unsigned extra = (depth / 8) + (depth * sizeof(struct nvme_cmd_info));
> + unsigned extra = DIV_ROUND_UP(depth, 8) + (depth * sizeof(
> + struct nvme_cmd_info));
Better to split like so:
unsigned extra = DIV_ROUND_UP(depth, 8) + (depth *
sizeof(struct nvme_cmd_info));
(some might argue for either:
unsigned extra = DIV_ROUND_UP(depth, 8);
extra += depth * sizeof(struct nvme_cmd_info);
or
unsigned extra;
extra = DIV_ROUND_UP(depth, 8) + (depth * sizeof(struct nvme_cmd_info));
but I prefer the way I've done it :-)
> };
>
> +#define NVME_CAP_MQES(cap) (cap & 0xffff)
> #define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff)
> #define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf)
>
This hunk failed to apply because of the added definition for NVME_CAP_MPSMIN
which was added in a patch from you I applied yesterday :-) So I fixed it.
prev parent reply other threads:[~2012-07-27 18:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 15:34 [PATCH] NVMe: Do not set IO queue depth beyond device max Keith Busch
2012-07-27 18:00 ` Matthew Wilcox [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=20120727180059.GL22985@linux.intel.com \
--to=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;
as well as URLs for NNTP newsgroup(s).