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 30AED156F45 for ; Wed, 19 Nov 2025 05:48:52 +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=1763531334; cv=none; b=oE/G/RnEouoNrXQXUe/HmPst4usUd528sINqYgP5djAJPfScH11VQiN6xhxBcy4clV4nOzK5viQcVyjj4i29dAakvMvKaSWXYP/sthygI/AcHiupLISzoGWgb1VnJHcGYGeZd8xg3krKLQ9F5G/qa0LiJO4w/JL6SCe1JwDWesc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763531334; c=relaxed/simple; bh=MWyTMN1zGHXF1YvxUetG9Fta5O0enkbRD5Dh+DM5VbE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L1XLfggYhQE+f/EOum47KtqOWmEGHK4RNMjbEzaMVVqJHJVh7zViN9Q+Z/blK70t9+wlYOiGdlHY6HjQR6sJUZnhGwgDPsgKofIyc+uVoO484ZB18ObzEuqQsmh74526PfK2sf/VF3xYY4w5wUc2eX44T+wn918utRIlhQE2iqA= 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 7E3C168AFE; Wed, 19 Nov 2025 06:48:48 +0100 (CET) Date: Wed, 19 Nov 2025 06:48:48 +0100 From: Christoph Hellwig To: Caleb Sander Mateos Cc: Keith Busch , Jens Axboe , Christoph Hellwig , 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: <20251119054848.GA20072@lst.de> References: <20251119021701.3165123-1-csander@purestorage.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20251119021701.3165123-1-csander@purestorage.com> User-Agent: Mutt/1.5.17 (2007-11-01) 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.