Re: [PATCH] nvme-pci: calculate iod and avg_seg_size just before use them

2018-01-14 Thread Sagi Grimberg
The calculation of iod and avg_seg_size maybe meaningless if nvme_pci_use_sgls returns before uses them. So calculate just before use them. The compiler will do the right thing here, but I see what you mean. I think Christoph has some SGL improvements coming, though, that will obviate this.

Re: [PATCH] nvme-pci: calculate iod and avg_seg_size just before use them

2018-01-11 Thread jianchao.wang
Hi Keith Thanks for your kindly response. On 01/11/2018 11:48 PM, Keith Busch wrote: > On Thu, Jan 11, 2018 at 01:09:39PM +0800, Jianchao Wang wrote: >> The calculation of iod and avg_seg_size maybe meaningless if >> nvme_pci_use_sgls returns before uses them. So calculate >> just before use them

Re: [PATCH] nvme-pci: calculate iod and avg_seg_size just before use them

2018-01-11 Thread Keith Busch
On Thu, Jan 11, 2018 at 01:09:39PM +0800, Jianchao Wang wrote: > The calculation of iod and avg_seg_size maybe meaningless if > nvme_pci_use_sgls returns before uses them. So calculate > just before use them. The compiler will do the right thing here, but I see what you mean. I think Christoph has

[PATCH] nvme-pci: calculate iod and avg_seg_size just before use them

2018-01-10 Thread Jianchao Wang
The calculation of iod and avg_seg_size maybe meaningless if nvme_pci_use_sgls returns before uses them. So calculate just before use them. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/p