NVMe: avoid kmalloc/kfree for smaller IO
authorJens Axboe <axboe@fb.com>
Thu, 22 Jan 2015 19:07:58 +0000 (12:07 -0700)
committerJens Axboe <axboe@fb.com>
Thu, 29 Jan 2015 17:25:34 +0000 (09:25 -0800)
Currently we allocate an nvme_iod for each IO, which holds the
sg list, prps, and other IO related info. Set a threshold of
2 pages and/or 8KB of data, below which we can just embed this
in the per-command pdu in blk-mq. For any IO at or below
NVME_INT_PAGES and NVME_INT_BYTES, we save a kmalloc and kfree.

For higher IOPS, this saves up to 1% of CPU time.

Signed-off-by: Jens Axboe <axboe@fb.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
drivers/block/nvme-core.c
include/linux/nvme.h

Simple merge
Simple merge