[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1504007201-12904-4-git-send-email-yang.zhang.wz@gmail.com>
Date: Tue, 29 Aug 2017 11:46:37 +0000
From: Yang Zhang <yang.zhang.wz@...il.com>
To: linux-kernel@...r.kernel.org
Cc: kvm@...r.kernel.org, wanpeng.li@...mail.com, mst@...hat.com,
pbonzini@...hat.com, tglx@...utronix.de, rkrcmar@...hat.com,
dmatlack@...gle.com, agraf@...e.de, peterz@...radead.org,
linux-doc@...r.kernel.org, Yang Zhang <yang.zhang.wz@...il.com>,
Quan Xu <quan.xu0@...il.com>, Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Borislav Petkov <bp@...en8.de>, Kyle Huey <me@...ehuey.com>,
Andy Lutomirski <luto@...nel.org>,
Len Brown <len.brown@...el.com>
Subject: [RFC PATCH v2 3/7] sched/idle: Add poll before enter real idle path
Add poll in do_idle. For UP VM, if there are running task, it will not
goes into idle path, so we only enable poll in SMP VM.
Signed-off-by: Yang Zhang <yang.zhang.wz@...il.com>
Signed-off-by: Quan Xu <quan.xu0@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Kyle Huey <me@...ehuey.com>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Len Brown <len.brown@...el.com>
Cc: linux-kernel@...r.kernel.org
---
arch/x86/kernel/process.c | 7 +++++++
kernel/sched/idle.c | 2 ++
2 files changed, 9 insertions(+)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 3ca1980..def4113 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -332,6 +332,13 @@ void arch_cpu_idle(void)
x86_idle();
}
+#if defined(CONFIG_SMP) && defined(CONFIG_PARAVIRT)
+void arch_cpu_idle_poll(void)
+{
+ paravirt_idle_poll();
+}
+#endif
+
/*
* We use this if we don't have any better idle routine..
*/
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index 6c23e30..b374744 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -74,6 +74,7 @@ static noinline int __cpuidle cpu_idle_poll(void)
}
/* Weak implementations for optional arch specific functions */
+void __weak arch_cpu_idle_poll(void) { }
void __weak arch_cpu_idle_prepare(void) { }
void __weak arch_cpu_idle_enter(void) { }
void __weak arch_cpu_idle_exit(void) { }
@@ -219,6 +220,7 @@ static void do_idle(void)
*/
__current_set_polling();
+ arch_cpu_idle_poll();
quiet_vmstat();
tick_nohz_idle_enter();
--
1.8.3.1
Powered by blists - more mailing lists