[parisc-linux] small patch for cpu_idle?

Matthew Wilcox willy@debian.org
Sun, 21 Oct 2001 21:21:18 +0100


On Sun, Oct 21, 2001 at 10:52:27AM -0700, Randolph Chung wrote:
> It appears to me that our cpu_idle is not quite right... what do you
> guys think about this:
>         while (1) {
> -               while (!current->need_resched) {
> -               }
> +               while (!current->need_resched) 
> +                       continue;
>                 schedule();
>                 check_pgt_cache();
>         }
> 
> otherwise when cpu_idle gets called we might get stuck in an inf loop
> (which happens, for example, when fsck requires manual intervention on
> startup).

I don't see any difference between

while (foo) { }

and

while (foo) continue;

need_resched is volatile:
        volatile long need_resched;

so I don't see that your change should have any effect.  Does it actually
generate different code?

-- 
Revolutions do not require corporate support.