[RFC PATCH] nvme-pci: Move the sg table allocation/free into init/exit_request

Baolin Wang baolin.wang at linux.alibaba.com
Mon Jun 29 08:49:52 EDT 2020


On Sun, Jun 28, 2020 at 09:55:12PM +0000, Chaitanya Kulkarni wrote:
> On 6/28/20 3:44 AM, Baolin Wang wrote:
> > Move the sg table allocation and free into the init_request() and
> > exit_request(), instead of allocating sg table when queuing requests,
> > which can benefit the IO performance.
> > 
> > Signed-off-by: Baolin Wang<baolin.wang at linux.alibaba.com>
> 
> The call to sg_init_table() uses blk_rq_nr_phys_segments in 
> nvme_map_data() with this patch we are blindly allocating SG table with
> NVME_MAX_SEGS, without any performance numbers it is hard to measure the 
> impact.

Not true, the original code also will allocate sg table with NVME_MAX_SEGS
if the request contains multiple segments, I just move the sg table allocation
to pre-allocate for each request, instead of allocating sg table when queuing
requests. Obviously it will save some memory allocation time when the request
contains seveval segments.

> 
> Can you share performance numbers ?
> 
> I'm particularly interested in for IOPS/BW/CPU/USAGE/Submission latency 
> and completion latency and perf numbers for the respective function in 
> to determine the overall impact.

>From my previous tests, I did not see obvious improvements, I think my
test case always create one segment for each request though I set bs >
4K. I can try to create special case to test multiple segments.
But as Keith commented, he did not like this patch, so...



More information about the Linux-nvme mailing list