From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932812AbeALBfu (ORCPT + 1 other); Thu, 11 Jan 2018 20:35:50 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:39828 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932340AbeALBfs (ORCPT ); Thu, 11 Jan 2018 20:35:48 -0500 Subject: Re: [PATCH] nvme-pci: calculate iod and avg_seg_size just before use them To: Keith Busch Cc: axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org References: <1515647379-1877-1-git-send-email-jianchao.w.wang@oracle.com> <20180111154857.GA2602@localhost.localdomain> From: "jianchao.wang" Message-ID: <6a128c20-bf35-8526-224c-7e0de88d0908@oracle.com> Date: Fri, 12 Jan 2018 09:31:21 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180111154857.GA2602@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8771 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=838 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801120015 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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. > > 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. > Yeah, that's great. Thanks Jianchao