Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934317AbeAKPpi (ORCPT + 1 other); Thu, 11 Jan 2018 10:45:38 -0500 Received: from mga06.intel.com ([134.134.136.31]:6896 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932668AbeAKPpg (ORCPT ); Thu, 11 Jan 2018 10:45:36 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,345,1511856000"; d="scan'208";a="10478609" Date: Thu, 11 Jan 2018 08:48:58 -0700 From: Keith Busch To: Jianchao Wang Cc: axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme-pci: calculate iod and avg_seg_size just before use them Message-ID: <20180111154857.GA2602@localhost.localdomain> References: <1515647379-1877-1-git-send-email-jianchao.w.wang@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515647379-1877-1-git-send-email-jianchao.w.wang@oracle.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 some SGL improvements coming, though, that will obviate this.