Re: [PATCH 1/4] rcu: Speed up calling of RCU tasks callbacks

From: Steven Rostedt
Date: Wed May 23 2018 - 20:42:56 EST


On Wed, 23 May 2018 17:51:19 -0700
Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote:

> Shouldn't this assignment be done outside the loop? I believe the variable
> will be initialized on each iteration.
>
> A program like this doesn't terminate:
>
> #include<stdio.h>
>
> int main() {
> for (;;) {
> int i = 10;
> if (!(i--))
> break;
> }
>
> return 0;
> }

Hey, it compiled, booted and tested. SHIP IT! ;-)

But yeah, a little egg on my face for that one. I blame it for the
first code I wrote right off of coming back from vacation.

>
> Otherwise looks good to me, I would initialize fract to 10 so its consistent
> with "HZ/10" in other parts of the code but I'm ok with either number.

I was thinking about that, but for some reason I thought 15. Not sure
why. I'm fine with dropping it down to 10. I'll send out a more proper
patch tomorrow.

Thanks!

-- Steve