From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>,
Sagi Grimberg <sagi@grimberg.me>,
linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme-pci: fix host memory buffer allocation size
Date: Thu, 28 Apr 2022 18:09:11 +0200 [thread overview]
Message-ID: <676c02ef-4bbc-43f3-b3e6-27a7d353f974@t-8ch.de> (raw)
In-Reply-To: <20220428150644.GA22685@lst.de>
On 2022-04-28 17:06+0200, Christoph Hellwig wrote:
> On Thu, Apr 28, 2022 at 04:44:47PM +0200, Thomas Weißschuh wrote:
> > Is the current code supposed to reach HMPRE? It does not for me.
> >
> > The code tries to allocate memory for HMPRE in chunks.
> > The best allocation would be to allocate one chunk for all of HMPRE.
> > If this fails we half the chunk size on each iteration and try again.
> >
> > On my hardware we start with a chunk_size of 4MiB and just allocate
> > 8 (hmmaxd) * 4 = 32 MiB which is worse than 1 * 200MiB.
>
> And that is because the hardware only has a limited set of descriptors.
Wouldn't it make more sense then to allocate as much memory as possible for
each descriptor that is available?
The comment in nvme_alloc_host_mem() tries to "start big".
But it actually starts with at most 4MiB.
And on devices that have hmminds > 4MiB the loop condition will never succeed
at all and HMB will not be used.
My fairly boring hardware already is at a hmminds of 3.3MiB.
> Is there any real problem you are fixing with this? Do you actually
> see a performance difference on a relevant workload?
I don't have a concrete problem or performance issue.
During some debugging I stumbled in my kernel logs upon
"nvme nvme0: allocated 32 MiB host memory buffer"
and investigated why it was so low.
next prev parent reply other threads:[~2022-04-28 16:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 10:19 Thomas Weißschuh
2022-04-28 14:36 ` Christoph Hellwig
2022-04-28 14:44 ` Thomas Weißschuh
2022-04-28 15:06 ` Christoph Hellwig
2022-04-28 16:09 ` Thomas Weißschuh [this message]
2022-05-10 7:03 ` Christoph Hellwig
2022-05-10 10:20 ` Thomas Weißschuh
2022-05-25 15:07 ` Thomas Weißschuh
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=676c02ef-4bbc-43f3-b3e6-27a7d353f974@t-8ch.de \
--to=linux@weissschuh.net \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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
all inboxes | Powered by JetHome®