Spdk/lib
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
..
accel lib/accel: Add CRC function 2020-05-15 08:12:13 +00:00
bdev lib/bdev: add a map file. 2020-04-15 22:10:08 +00:00
blob lib/blob: provide better log on blob_load failures 2020-05-13 07:46:43 +00:00
blobfs blobfs: remove g_caches_lock finally 2020-05-11 12:34:16 +00:00
conf lib/conf: make INI deprecation less verbose 2020-04-28 13:36:35 +00:00
env_dpdk env: add the device ID of virtio device 2020-05-12 08:12:22 +00:00
env_ocf lib/ocf_env: fix incorrect value for free memory estimate 2020-04-29 06:42:33 +00:00
event lib: replace fprintf(stderr,) by SPDK_ERRLOG 2020-05-07 10:42:40 +00:00
ftl lib: replace fprintf(stderr,) by SPDK_ERRLOG 2020-05-07 10:42:40 +00:00
idxd lib/idxd: implement idxd back end for CRC 2020-05-15 08:12:13 +00:00
ioat lib/ioat: add a map file. 2020-05-11 12:29:07 +00:00
iscsi lib/iscsi: fix possible memory leak. 2020-04-24 07:07:43 +00:00
json lib/json: add a map file. 2020-05-11 12:29:07 +00:00
jsonrpc lib/jsonrpc: remove spdk_ prefix from internal functions. 2020-05-11 12:29:07 +00:00
log lib/log: add spdk_vlog function 2020-05-15 08:10:39 +00:00
log_rpc lib/log_rpc: add a map file. 2020-05-11 12:29:07 +00:00
lvol lib/lvol: add a map file. 2020-05-11 12:29:07 +00:00
nbd lib/nbd: remove spdk prefix from internal functions. 2020-05-11 12:29:07 +00:00
net lib/net: remove spdk prefix from internal functions. 2020-05-11 12:29:07 +00:00
notify lib/notify: add a map file. 2020-05-11 12:29:07 +00:00
nvme nvme/pcie: reduce physically contiguous memory for CQ/SQ 2020-05-18 10:13:56 +00:00
nvmf lib/nvmf: remove spdk prefix from static functions in transport.c. 2020-05-12 21:49:03 +00:00
reduce lib/reduce: add a map file. 2020-05-12 21:49:03 +00:00
rocksdb global: rename copy to accel 2020-02-18 08:05:34 +00:00
rpc lib/rpc: remove spdk prefix from static functions in rpc.c 2020-05-12 21:49:03 +00:00
rte_vhost make: rev SO versions individually for libraries. 2020-03-18 08:02:30 +00:00
scsi lib/scsi: add map file 2020-04-24 07:06:52 +00:00
sock lib/sock: remove spdk prefix from static functions in sock.c 2020-05-12 21:49:03 +00:00
thread lib/thread: remove spdk prefix from static functions. 2020-05-12 21:49:03 +00:00
trace lib/trace: remove spdk prefix from static functions. 2020-05-14 10:37:14 +00:00
ut_mock test: add generic unlink wrapper 2020-05-06 12:43:57 +00:00
util lib/util: remove spdk prefix from static functions. 2020-05-14 10:37:14 +00:00
vhost lib/vhost: remove dependency on lib/event 2020-05-13 07:47:01 +00:00
virtio lib/virtio: add a map file. 2020-05-14 10:37:14 +00:00
vmd lib/vmd: add a map file. 2020-05-14 10:37:14 +00:00
Makefile lib/idxd: add low level idxd library 2020-04-23 15:48:32 +00:00