Spdk/lib/nvme
Tomasz Zawadzki d3cf561199 nvme/pcie: reduce physically contiguous memory for CQ/SQ
Following patch made sure that CQ/SQ are allocated in
physically contiguous manner:
(64db67) nvme/pcie: make sure sq and cq are physically contiguous

Using MAX_IO_QUEUE_ENTRIES is enough to make sure that either
queue does not span multiple hugepages.

Yet the patch made sure that whole page is occupied only
by the queue. Which unnecessarily increases memory consumption
up to two hugepages per each qpair.

This patch changes it so that each queue alignment is limited
up to its size.

Changes in hugepages consumed when allocating io_qpair in hello_world
application:
io_queue_size		Without patch	With patch
256			8MiB		0MiB
1024			12MiB		4MiB
4096			24MiB		16MiB
Note: 0MiB means no new hugepages were required and qpair fits into
previously allocated hugepages (see all steps before io_qpair
allocation in hello_world).

Intersting result of this patch is that since we required alignment
up to the hugepage size this resulted in reserving even two 2MiB
hugepages to account for DPDK internal malloc trailing element.
See alloc_sz in try_expand_heap_primary() within malloc_heap.c

This patch not only reduces overall memory reserved for the
queues, but decreases increase in heap consumption on DPDK side.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I75bf86e93674b4822d8204df3fb99458dec61e9c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2244
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-18 10:13:56 +00:00
..
Makefile lib/nvme: add a map file. 2020-05-12 21:49:03 +00:00
nvme_ctrlr_cmd.c nvme: save separate metadata size to nvme request 2020-04-02 07:02:38 +00:00
nvme_ctrlr_ocssd_cmd.c ocssd: hold lock when calling nvme_ctrlr_submit_admin_request 2019-02-15 21:27:58 +00:00
nvme_ctrlr.c nvme/ctrlr: Allow targets not supporting Keep Alive Timer feature ID 2020-05-07 10:41:31 +00:00
nvme_cuse.c lib: replace fprintf(stderr,) by SPDK_ERRLOG 2020-05-07 10:42:40 +00:00
nvme_cuse.h lib/nvme: add RPC for interacting with CUSE devices 2019-10-24 23:43:59 +00:00
nvme_fabric.c nvme: Add the priority field in struct spdk_nvme_transport_id 2020-04-24 15:53:34 +00:00
nvme_internal.h lib/nvme: set in_completion_context in poll group. 2020-04-24 16:36:03 +00:00
nvme_io_msg.c lib/nvme: assign NULL to external_io_msgs ring after free 2020-04-23 20:29:46 +00:00
nvme_io_msg.h lib/nvme: stop all NVMe io producers on detach 2019-11-28 12:36:58 +00:00
nvme_ns_cmd.c nvme: save separate metadata size to nvme request 2020-04-02 07:02:38 +00:00
nvme_ns_ocssd_cmd.c nvme: save separate metadata size to nvme request 2020-04-02 07:02:38 +00:00
nvme_ns.c nvme: Init the status object when tracking the req completion 2020-04-07 08:38:58 +00:00
nvme_opal_internal.h Revert "nvme/opal: deprecate spdk_opal_supported()" 2020-05-11 16:58:03 +00:00
nvme_opal.c Revert "nvme/opal: deprecate spdk_opal_supported()" 2020-05-11 16:58:03 +00:00
nvme_pcie.c nvme/pcie: reduce physically contiguous memory for CQ/SQ 2020-05-18 10:13:56 +00:00
nvme_poll_group.c lib/nvme: switch poll group to use connect/disconnect semantics. 2020-04-22 19:06:26 +00:00
nvme_qpair.c lib/nvme: abort all requests when disconnecting a qpair. 2020-04-22 19:06:26 +00:00
nvme_quirks.c nvme: add quirk for a minimum io queue size 2019-12-13 11:02:04 +00:00
nvme_rdma.c lib/nvme: remove lkey and rkey's warnings in nvme_rdma.c 2020-05-07 10:44:02 +00:00
nvme_tcp.c nvme: implement epoll in the tcp transport. 2020-04-24 19:38:00 +00:00
nvme_transport.c Transport: allocate a global array of transports 2020-05-15 08:11:54 +00:00
nvme_uevent.c nvme: add vfio driver parse event 2019-05-29 02:36:41 +00:00
nvme_uevent.h nvme: Add support of hotplug for vfio-attached devices. 2017-12-06 17:04:49 -05:00
nvme.c nvme: Add the priority field in struct spdk_nvme_transport_id 2020-04-24 15:53:34 +00:00
spdk_nvme.map lib/nvme: add a map file. 2020-05-12 21:49:03 +00:00