public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: linux-arch@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: Lots of possible arch breakage in cpu_idle!!
Date: Sun, 29 May 2005 04:39:42 -0700	[thread overview]
Message-ID: <20050529113942.GB20782@holomorphy.com> (raw)
In-Reply-To: <20050529101314.GN2057@holomorphy.com>

On Sun, May 29, 2005 at 08:03:45PM +1000, Nick Piggin wrote:
>> Hmm, it is against the latest -mm, with a couple of patches
>> backed out and one or two others applied :P
>> If you are just interested in looking at the arch code, I think
>> that should apply to any recent tree.
>> Otherwise, let me know off list.

On Sun, May 29, 2005 at 03:13:14AM -0700, William Lee Irwin III wrote:
> I'm only going to fiddle with the sparc32 bits.

Here's what I'd like to see in arch/sparc. Minor differences only.


Index: linux-2.6/arch/sparc/kernel/process.c
===================================================================
--- linux-2.6.orig/arch/sparc/kernel/process.c	2005-05-29 02:28:32.831865959 -0700
+++ linux-2.6/arch/sparc/kernel/process.c	2005-05-29 02:50:06.989124151 -0700
@@ -67,13 +67,6 @@
 struct task_struct *last_task_used_math = NULL;
 struct thread_info *current_set[NR_CPUS];
 
-/*
- * default_idle is new in 2.5. XXX Review, currently stolen from sparc64.
- */
-void default_idle(void)
-{
-}
-
 #ifndef CONFIG_SMP
 
 #define SUN4C_FAULT_HIGH 100
@@ -116,11 +109,15 @@
 			local_irq_restore(flags);
 		}
 
-		while((!need_resched()) && pm_idle) {
-			(*pm_idle)();
-		}
-
+		if (pm_idle)
+			while(!need_resched())
+				(*pm_idle)();
+		else
+			while (!need_resched())
+				cpu_relax();
+		preempt_enable_no_resched();
 		schedule();
+		preempt_disable();
 		check_pgt_cache();
 	}
 }
@@ -130,13 +127,15 @@
 /* This is being executed in task 0 'user space'. */
 void cpu_idle(void)
 {
+	set_thread_flag(TIF_POLLING_NRFLAG);
 	/* endless idle loop with no priority at all */
 	while(1) {
-		if(need_resched()) {
-			schedule();
-			check_pgt_cache();
-		}
-		barrier(); /* or else gcc optimizes... */
+		while (!need_resched())
+			cpu_relax();
+		preempt_enable_no_resched();
+		schedule();
+		preempt_disable();
+		check_pgt_cache();
 	}
 }
 

  reply	other threads:[~2005-05-29 11:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-29  5:25 Lots of possible arch breakage in cpu_idle!! Nick Piggin
2005-05-29  5:44 ` Andrew Morton
2005-05-29  8:45 ` William Lee Irwin III
2005-05-29 10:03   ` Nick Piggin
2005-05-29 10:13     ` William Lee Irwin III
2005-05-29 11:39       ` William Lee Irwin III [this message]
2005-05-29  9:42 ` William Lee Irwin III
2005-05-29 10:08   ` Nick Piggin
2005-05-29 10:14     ` William Lee Irwin III
2005-05-29 16:55 ` Richard Henderson
2005-05-29 20:41   ` David S. Miller
2005-05-29 20:56     ` Richard Henderson
2005-05-30  0:37   ` Nick Piggin
2005-05-30 11:01 ` Martin Schwidefsky
2005-05-30 11:18   ` Nick Piggin
2005-05-30 11:34     ` Martin Schwidefsky
2005-05-30 11:49       ` Nick Piggin
2005-05-31  8:56 ` David Howells
2005-05-31  9:02   ` Nick Piggin
2005-05-31  9:05     ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050529113942.GB20782@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox