From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43E77306499 for ; Thu, 20 Nov 2025 06:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763621402; cv=none; b=Gc5JyYwg5nchmY2hyKoaCDZD/zsAVhnGHmjAXt0GD3OaZK945/AUjj5atFlU4uLo6aLSsp2MvNs7DVNCH0WrqxrHzFP2dDEnEE4bEU4X7T0HCUa7x2P4iz9NRVqic+XRdJ7xV5p9EN9M0nUjYkZunSQf+6Orj9fi8yEXHwpEiaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763621402; c=relaxed/simple; bh=d5IyjrlTs3ESR3alKqbqILvTv0+J9J/AteB3iGyQ1KI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tZpaPQdXeOcPpzIiYW0lVu+jw3ahR+nEuLlvRtSbxpLU3Tfb9vKAD8DktX+dg6veZO6tFZCnjynoi32C0OV1X+yhpm8dm1cBkh7MlgEg3cYTdvPTTVZSZ92SmPfxF+hUXozj6VxmC1ArdDFZX4u70Lr5cvomN3kPlZeKLA7NNhs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 6A02468B05; Thu, 20 Nov 2025 07:49:55 +0100 (CET) Date: Thu, 20 Nov 2025 07:49:55 +0100 From: Christoph Hellwig To: Caleb Sander Mateos Cc: Christoph Hellwig , Keith Busch , Jens Axboe , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme-pci: deduplicate empty request list checks in nvme_queue_rqs() Message-ID: <20251120064955.GA30432@lst.de> References: <20251119021701.3165123-1-csander@purestorage.com> <20251119054848.GA20072@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Wed, Nov 19, 2025 at 08:01:30AM -0800, Caleb Sander Mateos wrote: > On Tue, Nov 18, 2025 at 9:48 PM Christoph Hellwig wrote: > > > > On Tue, Nov 18, 2025 at 07:17:00PM -0700, Caleb Sander Mateos wrote: > > > nvme_queue_rqs() checks that nvmeq is non-NULL before calling > > > nvme_submit_cmds() and nvme_submit_cmds() checks that submit_list is > > > non-empty before doing anything. A NULL nvmeq means no requests were > > > processed from the rqlist in nvme_queue_rqs() since the last call to > > > nvme_submit_cmds(), which implies submit_list is empty. So just check > > > that submit_list is non-empty before calling nvme_submit_cmds() and drop > > > the check for NULL nvmeq. > > > > What is the rationale for this? I had a hard time understanding the > > logic in the new version, so I don't think this helps with readability > > at least. > > Just trying to avoid some branches. But if you prefer the current > version, that's fine. I find the current version easier to follow. If there is a good reason for the new variant I'm ok with it.