Re: [PATCH] block: Limit number of items taken from the I/O scheduler in one go

From: Bart Van Assche
Date: Fri Feb 07 2020 - 15:19:38 EST


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.