[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <10c64a02-91fe-c2af-4c0c-dc9677f9b223@acm.org>
Date: Fri, 7 Feb 2020 12:19:33 -0800
From: Bart Van Assche <bvanassche@....org>
To: Salman Qazi <sqazi@...gle.com>
Cc: Jens Axboe <axboe@...nel.dk>, Ming Lei <ming.lei@...hat.com>,
linux-block@...r.kernel.org,
Linux Kernel Mailing List <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] block: Limit number of items taken from the I/O scheduler
in one go
On 2/7/20 10:45 AM, Salman Qazi wrote:
> If I were to write this as a for-loop, it will look like this:
>
> for (i = 0; i == 0 || (run_again && i < 2); i++) {
> /* another level of 8 character wide indentation */
> run_again = false;
> /* a bunch of code that possibly sets run_again to true
> }
>
> if (run_again)
> blk_mq_run_hw_queue(hctx, true);
That's not what I meant. What I meant is a loop that iterates at most
two times and also to break out of the loop if run_again == false.
BTW, I share your concern about the additional indentation by eight
positions. How about avoiding deeper indentation by introducing a new
function?
Thanks,
Bart.
Powered by blists - more mailing lists