Skip to contentSkip to conversation

nvme-cli: Support for hugetlbfs

RFC In review Keith Busch 3 participants 4 messages Nov 5, 2019 – Nov 6, 2019

Subsystems (2)
lore
Share & tools
lore

Keith Busch

author maintainer
#0 lore raw

RFC 1/1 nvme-cli: Support for hugetlbfs

Some commands require exceptionally large data transfers, and the kernel driver supports only a limited number of phyiscal segments per command. To help support large transfers, try to allocate physically contiguous space via hugetlbfs.

Rather than deal with the nuances of allocating huge pages, this patch requires libhugetlbfs be installed on the host system.

---
 Makefile |  7 ++++++
 nvme.c   | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 73 insertions(+), 7 deletions(-)
Makefile +7 -0
index 1dd8c0e..8bcf5a5 100644
@@ -2,6 +2,7 @@ CFLAGS ?= -O2 -g -Wall -Werror
 override CFLAGS += -std=gnu99 -I.
 override CPPFLAGS += -D_GNU_SOURCE -D__CHECK_ENDIAN__
 LIBUUID = $(shell $(LD) -o /dev/null -luuid >/dev/null 2>&1; echo $$?)
+LIBHUGETLBFS = $(shell $(LD) -o /dev/null -lhugetlbfs >/dev/null 2>&1; echo $$?)
 HAVE_SYSTEMD = $(shell pkg-config --exists systemd  --atleast-version=232; echo $$?)
 NVME = nvme
 INSTALL ?= install
@@ -21,6 +22,12 @@ ifeq ($(LIBUUID),0)
 	override LIB_DEPENDS += uuid
 endif
 
+ifeq ($(LIBHUGETLBFS),0)
+	override LDFLAGS += -lhugetlbfs
+	override CFLAGS += -DLIBHUGETLBFS
+	override LIB_DEPENDS += hugetlbfs
+endif
+
 INC=-Iutil
 
 ifeq ($(HAVE_SYSTEMD),0)
nvme.c +66 -7

143 lines not on this page · raw message

Signature · 7 lines
2.21.0


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by on v1 1/1
#1 lore raw

Thanks Keith, this very useful, looks good.

Quoted 10 lines · Keith Busch

Some commands require exceptionally large data transfers, and the kernel driver supports only a limited number of phyiscal segments per command. To help support large transfers, try to allocate physically contiguous space via hugetlbfs.

Rather than deal with the nuances of allocating huge pages, this patch requires libhugetlbfs be installed on the host system.

---

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Keith Busch
Quoted 7 lines · Keith Busch

Some commands require exceptionally large data transfers, and the kernel driver supports only a limited number of phyiscal segments per command. To help support large transfers, try to allocate physically contiguous space via hugetlbfs.

Rather than deal with the nuances of allocating huge pages, this patch requires libhugetlbfs be installed on the host system.

LGTM, and solves a real issue with user issued admin commands that we can't break up.

Signature · 7 lines
Jens Axboe


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme