From 6aa8af02b4df21b00610a156dba6e1c7e3194441 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 30 Jun 2025 17:04:54 +0200 Subject: [PATCH] doc: add note about huge TLB when using fw-download Add a comment why fw-download is depending on huge TBL and what do to when the allocation fails. Signed-off-by: Daniel Wagner --- Documentation/nvme-fw-download.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/nvme-fw-download.txt b/Documentation/nvme-fw-download.txt index a45589cea3..204e78090c 100644 --- a/Documentation/nvme-fw-download.txt +++ b/Documentation/nvme-fw-download.txt @@ -36,6 +36,20 @@ Download command. It is applied following a reset, where the image to apply and the firmware slot it should be committed to is specified with the Firmware Commit command (nvme fw-commit ). +Note: nvme-cli must allocate a contiguous (linear) memory buffer and map +the firmware binary into it. To do this, nvme-cli first attempts to +allocate the buffer using huge TLB pages. If allocation using huge pages +fails, it falls back to using posix_memalign() combined with madvise(), +though this is also likely to fail. + +To increase the likelihood of success, you may want to pre-allocate a +number of huge pages before initiating the firmware download: + + echo 20 > /proc/sys/vm/nr_hugepages + +For more details, refer to: +https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt + OPTIONS ------- -f ::