Spdk/module/bdev/xnvme/bdev_xnvme.h
Simon A. F. Lund b99b00e595 bdev_xnvme: add option to conserve cpu and set default to false
To achieve the highest possible IO-rates and lowest latency, then CPU
cycles must be spent processing IO. This commit introduces three
different techniques dependendent on the 'io_mechanism' used.

For 'libaio', xNVMe is instructued via 'opts.poll_io' to not wait for
completions, thus xnvme_queue_poke() returns immmediatly, the user can
then call xnvme_queue_poke() as frequently as desired. This requires
xNVMe v0.5.0. Earlier versions will ignore 'opts.poll_io' for 'libaio'.

For 'io_uring', xNVMe is instructed via 'opts.poll_io' to enable
IORING_SETUP_IOPOLL.

For 'io_uring_cmd', xNVMe is instructued via 'opts.poll_sq' to enable
IORING_SETUP_SQPOLL, this sets up a kernel-side thread reaping
completions from user-space on the ring. Note that 'io_uring_cmd'
requires liburing >= 2.2.

This commit enables the above by default. The above can be disabled by
setting 'conserve_cpu' to true on the bdev-setup.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: Id54f1e59733ce9ae3b174ad4562904d868d4ef4f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14678
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-12-21 09:33:27 +00:00

24 lines
614 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) Samsung Electronics Co., Ltd.
* All rights reserved.
*/
#ifndef SPDK_BDEV_XNVME_H
#define SPDK_BDEV_XNVME_H
#include "spdk/stdinc.h"
#include "spdk/queue.h"
#include "spdk/bdev.h"
#include "spdk/bdev_module.h"
typedef void (*spdk_delete_xnvme_complete)(void *cb_arg, int bdeverrno);
struct spdk_bdev *create_xnvme_bdev(const char *name, const char *filename,
const char *io_mechanism, bool conserve_cpu);
void delete_xnvme_bdev(struct spdk_bdev *bdev, spdk_delete_xnvme_complete cb_fn, void *cb_arg);
#endif /* SPDK_BDEV_XNVME_H */