public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Daniel Wagner <dwagner@suse.de>,
	Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	Keith Busch <kbusch@kernel.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Yi Zhang <yi.zhang@redhat.com>
Subject: Re: [PATCH blktests v0] nvme/029: reserve hugepages for lager allocations
Date: Wed, 21 Feb 2024 18:30:10 +0900	[thread overview]
Message-ID: <99bba6e6-1ae3-49d2-842b-680257cedbad@kernel.org> (raw)
In-Reply-To: <eo2iqix7vzrjgjs6bhx44s3rxblxorc4za62rrzaw5hqb5xqlh@uad7uc4lx35z>

On 2/21/24 16:37, Daniel Wagner wrote:
> On Wed, Feb 21, 2024 at 06:22:29AM +0000, Shinichiro Kawasaki wrote:
>> I found this changes makes the test case fail when the kernel does not have
>> CONFIG_HUGETLBFS. Without the config, /proc/sys/vm/nr_hugepages does not
>> exist.
>>
>> When CONFIG_HUGETLBFS is not defined, should we skip this test case?
> 
> Obviously, we should aim for really solid test cases. Though it is not
> guaranteed that the test will pass even with CONFIG_HUGETLBS enabled. I
> suspect we would need to make some more preparation steps that the
> allocation has a high change to pass. Though I haven't really looked
> into what the necessary steps would be. The sysfs exposes a few more
> knobs to play with.

"echo 3 > /proc/sys/vm/drop_caches" before mounting hugetlbfs should allow for
the big pages to fit... Still no guarantees but likely that will lower setup
failure frequency.

> 
>> If this is
>> the case, we can add "_have_kernel_option HUGETLBFS" in requires(). If not, we
>> should check existence of /proc/sys/vm/nr_hugepages before touching it, like:
>>
>>        if [[ -r /proc/sys/vm/nr_hugepages &&
>>                      "$(cat /proc/sys/vm/nr_hugepages)" -eq 0 ]]; then
> 
> Sure, I'll add this and also fix the typos in the commit message.
> 
>>
>> Also I suggest to add in-line comment to help understanding why nr_hugepages
>> sysfs needs change. Something like,
>>
>> # nvme-cli may fail to allocate linear memory for rather large IO buffers.
>> # Increase nr_hugepages to allow nvme-cli to try the linear memory allocation
>> # from HugeTLB pool.
> 
> Ok.
> 

-- 
Damien Le Moal
Western Digital Research



      reply	other threads:[~2024-02-21  9:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20  8:13 [PATCH blktests v0] nvme/029: reserve hugepages for lager allocations Daniel Wagner
2024-02-21  6:22 ` Shinichiro Kawasaki
2024-02-21  7:37   ` Daniel Wagner
2024-02-21  9:30     ` Damien Le Moal [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=99bba6e6-1ae3-49d2-842b-680257cedbad@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=chaitanyak@nvidia.com \
    --cc=dwagner@suse.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=yi.zhang@redhat.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