On Tue, Apr 23, 2019 at 08:37:15AM -0700, Bart Van Assche wrote: > On Tue, 2019-04-23 at 18:32 +0800, Ming Lei wrote: > > #define SCSI_INLINE_PROT_SG_CNT 1 > > > > +#define SCSI_INLINE_SG_CNT 2 > > So this patch inserts one kmalloc() and one kfree() call in the hot path > for every SCSI request with more than two elements in its scatterlist? Isn't Slab or its variants are designed for fast path, and NVMe PCI uses slab for allocating sg list in fast path too. > "2" too low? Or in other words, what is the performance impact of this patch > for a real-world workload? 2 is used by NVMe PCI for a while, and even recently it is reduced to 1. I have run big BS(256k) fio test on scsi_debug(can_queue: 256, submit queues: 12 LUNs: 4, delay: 0, io sched: none), not see obvious performance difference by this patch. Thanks, Ming