[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200424064206.GA23666@lst.de>
Date: Fri, 24 Apr 2020 08:42:06 +0200
From: Christoph Hellwig <hch@....de>
To: Salman Qazi <sqazi@...gle.com>
Cc: Jens Axboe <axboe@...nel.dk>, Ming Lei <ming.lei@...hat.com>,
Bart Van Assche <bvanassche@....org>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Jesse Barnes <jsbarnes@...gle.com>,
Gwendal Grignou <gwendal@...gle.com>,
Hannes Reinecke <hare@...e.com>, Christoph Hellwig <hch@....de>
Subject: Re: [PATCH v2] block: Limit number of items taken from the I/O
scheduler in one go
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.
Powered by blists - more mailing lists