[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:29:47 EDT 2020
On Sun, Jun 28, 2020 at 06:31:43PM -0700, Keith Busch wrote:
> On Sun, Jun 28, 2020 at 06:34:46PM +0800, 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.
>
> If you want to pre-allocate something per-request, you can add the size
> to the tagset's cmd_size.
>
> But this is adding almost 4k per request. Considering how many requests
> we try to allocate, that's a bit too large to count on being available
> or sequestor for this driver.
I saw other block drivers (mmc, scsi) had allocated the sg table in
init_request() instead of allocating them when queuing requests to benefit
performance, but I am not sure why the nvme did not do like this. OK,
now I think I know the reason, thanks.
More information about the Linux-nvme
mailing list