All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Caleb Sander Mateos <csander@purestorage.com>
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
	Jens Axboe <axboe@kernel.dk>, Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvme-pci: deduplicate empty request list checks in nvme_queue_rqs()
Date: Thu, 20 Nov 2025 07:49:55 +0100	[thread overview]
Message-ID: <20251120064955.GA30432@lst.de> (raw)
In-Reply-To: <CADUfDZosKsY3TBwPRoEvOCTErcaC3HcR3ChHj=io+=m_EPqX+Q@mail.gmail.com>

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 <hch@lst.de> 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.



      reply	other threads:[~2025-11-20  6:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19  2:17 [PATCH] nvme-pci: deduplicate empty request list checks in nvme_queue_rqs() Caleb Sander Mateos
2025-11-19  5:48 ` Christoph Hellwig
2025-11-19 16:01   ` Caleb Sander Mateos
2025-11-20  6:49     ` Christoph Hellwig [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251120064955.GA30432@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.