linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] um: Use generic idle loop
@ 2013-04-16 21:53 Richard Weinberger
  2013-04-17  9:01 ` [tip:smp/hotplug] " tip-bot for Richard Weinberger
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Weinberger @ 2013-04-16 21:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, user-mode-linux-devel, Richard Weinberger

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/um/Kconfig.common   |  1 +
 arch/um/kernel/process.c | 27 ++++-----------------------
 2 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index bceee66..5783406 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -12,6 +12,7 @@ config UML
 	select GENERIC_CPU_DEVICES
 	select GENERIC_IO
 	select GENERIC_CLOCKEVENTS
+	select GENERIC_IDLE_LOOP
 	select TTY # Needed for line.c
 
 config MMU
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index b462b13..bbcef52 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -210,33 +210,14 @@ void initial_thread_cb(void (*proc)(void *), void *arg)
 	kmalloc_ok = save_kmalloc_ok;
 }
 
-void default_idle(void)
+void arch_cpu_idle(void)
 {
 	unsigned long long nsecs;
 
-	while (1) {
-		/* endless idle loop with no priority at all */
-
-		/*
-		 * although we are an idle CPU, we do not want to
-		 * get into the scheduler unnecessarily.
-		 */
-		if (need_resched())
-			schedule();
-
-		tick_nohz_idle_enter();
-		rcu_idle_enter();
-		nsecs = disable_timer();
-		idle_sleep(nsecs);
-		rcu_idle_exit();
-		tick_nohz_idle_exit();
-	}
-}
-
-void cpu_idle(void)
-{
 	cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
-	default_idle();
+	nsecs = disable_timer();
+	idle_sleep(nsecs);
+	local_irq_enable();
 }
 
 int __cant_sleep(void) {
-- 
1.8.1.4


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

* [tip:smp/hotplug] um: Use generic idle loop
  2013-04-16 21:53 [PATCH] um: Use generic idle loop Richard Weinberger
@ 2013-04-17  9:01 ` tip-bot for Richard Weinberger
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Richard Weinberger @ 2013-04-17  9:01 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, richard, tglx

Commit-ID:  8198c1696a2cd15d436ade172bfd8085f5f818d3
Gitweb:     http://git.kernel.org/tip/8198c1696a2cd15d436ade172bfd8085f5f818d3
Author:     Richard Weinberger <richard@nod.at>
AuthorDate: Tue, 16 Apr 2013 23:53:29 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 17 Apr 2013 10:39:38 +0200

um: Use generic idle loop

Signed-off-by: Richard Weinberger <richard@nod.at>
Cc: user-mode-linux-devel@lists.sourceforge.net
Link: http://lkml.kernel.org/r/1366149209-24787-1-git-send-email-richard@nod.at
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/um/Kconfig.common   |  1 +
 arch/um/kernel/process.c | 27 ++++-----------------------
 2 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index bceee66..5783406 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -12,6 +12,7 @@ config UML
 	select GENERIC_CPU_DEVICES
 	select GENERIC_IO
 	select GENERIC_CLOCKEVENTS
+	select GENERIC_IDLE_LOOP
 	select TTY # Needed for line.c
 
 config MMU
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index b462b13..bbcef52 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -210,33 +210,14 @@ void initial_thread_cb(void (*proc)(void *), void *arg)
 	kmalloc_ok = save_kmalloc_ok;
 }
 
-void default_idle(void)
+void arch_cpu_idle(void)
 {
 	unsigned long long nsecs;
 
-	while (1) {
-		/* endless idle loop with no priority at all */
-
-		/*
-		 * although we are an idle CPU, we do not want to
-		 * get into the scheduler unnecessarily.
-		 */
-		if (need_resched())
-			schedule();
-
-		tick_nohz_idle_enter();
-		rcu_idle_enter();
-		nsecs = disable_timer();
-		idle_sleep(nsecs);
-		rcu_idle_exit();
-		tick_nohz_idle_exit();
-	}
-}
-
-void cpu_idle(void)
-{
 	cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
-	default_idle();
+	nsecs = disable_timer();
+	idle_sleep(nsecs);
+	local_irq_enable();
 }
 
 int __cant_sleep(void) {

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

end of thread, other threads:[~2013-04-17  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-16 21:53 [PATCH] um: Use generic idle loop Richard Weinberger
2013-04-17  9:01 ` [tip:smp/hotplug] " tip-bot for Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).