linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] nvme: Avoid preallocating big SGL for data
@ 2019-11-24 16:38 Israel Rukshin
  2019-11-24 16:38 ` [PATCH 1/3] nvme-rdma: " Israel Rukshin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Israel Rukshin @ 2019-11-24 16:38 UTC (permalink / raw)
  To: Linux-nvme, Sagi Grimberg, Christoph Hellwig, James Smart, Keith Busch
  Cc: Israel Rukshin, Max Gurtovoy

When nvme allocates a tagset it preallocates a big buffer for the IO SGL
based on SG_CHUNK_SIZE.

Modern DMA engines are often capable of dealing with very big segments so
the SG_CHUNK_SIZE is often too big. SG_CHUNK_SIZE results in a static 4KB
SGL allocation per command.

If a controller has lots of deep queues, preallocation for the sg list can
consume substantial amounts of memory. Switch to runtime allocation for SGL
for lists longer than 2 entries. This is the approach used by NVMe PCI so
it should be reasonable for NVMeOF as well. Runtime SGL allocation has
always been the case for the legacy I/O path so this is nothing new.

The preallocated small SGL depends on SG_CHAIN so if the ARCH doesn't
support SG_CHAIN, use only runtime allocation for the SGL.

Israel Rukshin (3):
  nvme-rdma: Avoid preallocating big SGL for data
  nvme-fc: Avoid preallocating big SGL for data
  nvmet-loop: Avoid preallocating big SGL for data

 drivers/nvme/host/fc.c     |  8 ++++----
 drivers/nvme/host/nvme.h   |  6 ++++++
 drivers/nvme/host/rdma.c   | 10 +++++-----
 drivers/nvme/target/loop.c |  8 ++++----
 4 files changed, 19 insertions(+), 13 deletions(-)

-- 
1.8.3.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-11-26 17:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-24 16:38 [PATCH 0/3] nvme: Avoid preallocating big SGL for data Israel Rukshin
2019-11-24 16:38 ` [PATCH 1/3] nvme-rdma: " Israel Rukshin
2019-11-26 16:53   ` Christoph Hellwig
2019-11-24 16:38 ` [PATCH 2/3] nvme-fc: " Israel Rukshin
2019-11-25 17:04   ` James Smart
2019-11-24 16:38 ` [PATCH 3/3] nvmet-loop: " Israel Rukshin
2019-11-25  2:24   ` Chaitanya Kulkarni
2019-11-26 16:53   ` Christoph Hellwig
2019-11-26 17:40   ` Keith Busch

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).