All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] small patch for cpu_idle?
@ 2001-10-21 17:52 Randolph Chung
  2001-10-21 20:21 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Randolph Chung @ 2001-10-21 17:52 UTC (permalink / raw)
  To: parisc-linux

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
diff -u -r1.38 process.c
--- process.c   2001/10/09 19:43:35     1.38
+++ process.c   2001/10/21 17:46:53
@@ -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
-- 
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [parisc-linux] small patch for cpu_idle?
  2001-10-21 17:52 [parisc-linux] small patch for cpu_idle? Randolph Chung
@ 2001-10-21 20:21 ` Matthew Wilcox
  2001-10-22  1:35   ` Randolph Chung
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2001-10-21 20:21 UTC (permalink / raw)
  To: Randolph Chung; +Cc: parisc-linux

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [parisc-linux] small patch for cpu_idle?
  2001-10-21 20:21 ` Matthew Wilcox
@ 2001-10-22  1:35   ` Randolph Chung
  0 siblings, 0 replies; 3+ messages in thread
From: Randolph Chung @ 2001-10-22  1:35 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: parisc-linux

> 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
-- 
Debian Developer <tausq@debian.org>
http://www.TauSq.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-22  1:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-21 17:52 [parisc-linux] small patch for cpu_idle? Randolph Chung
2001-10-21 20:21 ` Matthew Wilcox
2001-10-22  1:35   ` Randolph Chung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.