From ff182630dc3911c73e2ef5c9f3bb4978308d9232 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Mon, 4 Feb 2019 10:34:09 -0700 Subject: [PATCH] bdev: explicitly mark _spdk_bdev_io_submit as inline This function gets used as a function pointer, which seems to keep the compiler from trying to inline the function. Stack manipulation was showing up in the perf profile pointing to this. Marking the function as inline gets it actually inlined in the hot I/O path. Improves bdevperf microbenchmark from 78M to 85M IO/s. Cores are virtually identical - 11.4M on core 0 and 10.4-10.6M on remaining cores. Signed-off-by: Jim Harris Change-Id: Iadced071dfc07fc09db6da3571c930988b2dc3fd Reviewed-on: https://review.gerrithub.io/c/443278 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- lib/bdev/bdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c index 9c53877d2..f0d960a2c 100644 --- a/lib/bdev/bdev.c +++ b/lib/bdev/bdev.c @@ -1638,7 +1638,10 @@ _spdk_bdev_io_split(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io) _spdk_bdev_io_split_with_payload(bdev_io); } -static void +/* Explicitly mark this inline, since it's used as a function pointer and otherwise won't + * be inlined, at least on some compilers. + */ +static inline void _spdk_bdev_io_submit(void *ctx) { struct spdk_bdev_io *bdev_io = ctx;