Thread (19 messages) 19 messages, 6 authors, 2020-04-23

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

From: Bart Van Assche <bvanassche@acm.org>
Date: 2020-02-07 20:19:37
Also in: lkml

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help