Skip to contentSkip to conversation

small patch for cpu_idle?

parisc-linux Randolph Chung 3 participants 3 messages Oct 21, 2001 – Oct 22, 2001

lore
Share & tools
lore
#0 lore raw

It appears to me that our cpu_idle is not quite right... what do you guys think about this:

Index: process.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/process.c,v retrieving revision 1.38

10/21 17:46:53 renamed from 10/09 19:43:35 1.38 +2 -2
diff -u -r1.38 process.c
@@ -67,8 +67,8 @@
        current->counter = -100;
 
        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).

randolph

Signature · 4 lines
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^
#1 lore raw
Quoted 11 lines · Randolph Chung

It appears to me that our cpu_idle is not quite right... what do you guys think about this:

        while (1) {
10/21 17:46:53 renamed from 10/09 19:43:35 1.38 +2 -2
-               while (!current->need_resched) {
-               }
+               while (!current->need_resched) 
+                       continue;
                schedule();
                check_pgt_cache();
        }
Quoted 3 lines

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?

Signature · 1 line
Revolutions do not require corporate support.
#2 lore raw
Quoted 7 lines

I don't see any difference between

while (foo) { }

and

while (foo) continue;

i was obviously smoking something funny :-(

ok, i'll look into more why i get a hang in cpu_idle when fsck requires manual intervention on startup.

randolph

Signature · 2 lines
Debian Developer <[email protected]>
http://www.TauSq.org/