nvme: avoid kmalloc/kfree for smaller IO
authorJens Axboe <axboe@fb.com>
Tue, 27 May 2014 20:12:11 +0000 (14:12 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 29 May 2014 15:54:27 +0000 (09:54 -0600)
commit04497c3394f3220111d4274704a1ff6bdd3ceae3
tree45bebd377331574603f7bb0e0e677a9b3852cb68
parent7433cb06dff34e0ad2356f2db6587f33edf86007
nvme: avoid kmalloc/kfree for smaller IO

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.

Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nvme-core.c
include/linux/nvme.h