From: Christoph Hellwig <hch@lst.de>
To: Salman Qazi <sqazi@google.com>
Cc: Jens Axboe <axboe@kernel.dk>, Ming Lei <ming.lei@redhat.com>,
Bart Van Assche <bvanassche@acm.org>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Jesse Barnes <jsbarnes@google.com>,
Gwendal Grignou <gwendal@google.com>,
Hannes Reinecke <hare@suse.com>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2] block: Limit number of items taken from the I/O scheduler in one go
Date: Fri, 24 Apr 2020 08:42:06 +0200 [thread overview]
Message-ID: <20200424064206.GA23666@lst.de> (raw)
In-Reply-To: <20200424061529.GA23303@lst.de>
On Fri, Apr 24, 2020 at 08:15:29AM +0200, Christoph Hellwig wrote:
> This is a weird loop. I'd split the code betweem the again label and
> the run_again check here into a __blk_mq_sched_dispatch_requests
> helper, and then you can do:
>
> if (__blk_mq_sched_dispatch_requests()) {
> if (__blk_mq_sched_dispatch_requests())
> blk_mq_run_hw_queue(hctx, true);
> }
>
> here. Preferably with ha good comment explaining the logic.
Also I wonder if inverting the return values in the lower level function
would make things a little more readable - a true return suggests
everything worked fine. Alternative 0 for sucess and -EAGAIN for needs
a retry also would be pretty self-documenting.
next prev parent reply other threads:[~2020-04-24 6:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-23 21:05 [PATCH v2] block: Limit number of items taken from the I/O scheduler in one go Salman Qazi
2020-04-23 21:30 ` Jens Axboe
2020-04-24 1:41 ` Salman Qazi
2020-04-24 6:15 ` Christoph Hellwig
2020-04-24 6:42 ` Christoph Hellwig [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-04-23 21:48 Salman Qazi
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=20200424064206.GA23666@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=gwendal@google.com \
--cc=hare@suse.com \
--cc=jsbarnes@google.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=sqazi@google.com \
/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.