Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 281661 Details for
Bug 416141
FEAT:[RHEL5.2][XEN] idle=poll
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
idle=poll feature straight from xen-unstable
linux-2.6-xen-idle-poll.patch (text/x-patch), 4.09 KB, created by
Markus Armbruster
on 2007-12-07 21:53:51 UTC
(
hide
)
Description:
idle=poll feature straight from xen-unstable
Filename:
MIME Type:
Creator:
Markus Armbruster
Created:
2007-12-07 21:53:51 UTC
Size:
4.09 KB
patch
obsolete
>xen-unstable.hg changesets trivially rediffed: >13213:bf25488db8eb >13217:338ceb7b1f09 > >diff -rupN kernel-2.6.18/linux-2.6.18.noarch/arch/i386/kernel/process-xen.c kernel-2.6.18-patched/linux-2.6.18.noarch/arch/i386/kernel/process-xen.c >--- a/arch/i386/kernel/process-xen.c 2007-06-06 00:07:28.000000000 +0200 >+++ b/arch/i386/kernel/process-xen.c 2007-06-05 20:35:08.000000000 +0200 >@@ -96,8 +96,24 @@ void enable_hlt(void) > > EXPORT_SYMBOL(enable_hlt); > >-/* XXX XEN doesn't use default_idle(), poll_idle(). Use xen_idle() instead. */ >-void xen_idle(void) >+/* >+ * On SMP it's slightly faster (but much more power-consuming!) >+ * to poll the ->work.need_resched flag instead of waiting for the >+ * cross-CPU IPI to arrive. Use this option with caution. >+ */ >+static void poll_idle(void) >+{ >+ local_irq_enable(); >+ >+ asm volatile( >+ "2:" >+ "testl %0, %1;" >+ "rep; nop;" >+ "je 2b;" >+ : : "i"(_TIF_NEED_RESCHED), "m" (current_thread_info()->flags)); >+} >+ >+static void xen_idle(void) > { > local_irq_disable(); > >@@ -148,17 +164,22 @@ void cpu_idle(void) > /* endless idle loop with no priority at all */ > while (1) { > while (!need_resched()) { >+ void (*idle)(void); > > if (__get_cpu_var(cpu_idle_state)) > __get_cpu_var(cpu_idle_state) = 0; > > rmb(); >+ idle = pm_idle; >+ >+ if (!idle) >+ idle = xen_idle; > > if (cpu_is_offline(cpu)) > play_dead(); > > __get_cpu_var(irq_stat).idle_timestamp = jiffies; >- xen_idle(); >+ idle(); > } > preempt_enable_no_resched(); > schedule(); >@@ -194,9 +215,22 @@ void cpu_idle_wait(void) > } > EXPORT_SYMBOL_GPL(cpu_idle_wait); > >-/* XXX XEN doesn't use mwait_idle(), select_idle_routine(), idle_setup(). */ >-/* Always use xen_idle() instead. */ >-void __devinit select_idle_routine(const struct cpuinfo_x86 *c) {} >+void __devinit select_idle_routine(const struct cpuinfo_x86 *c) >+{ >+} >+ >+static int __init idle_setup (char *str) >+{ >+ if (!strncmp(str, "poll", 4)) { >+ printk("using polling idle threads.\n"); >+ pm_idle = poll_idle; >+ } >+ >+ boot_option_idle_override = 1; >+ return 1; >+} >+ >+__setup("idle=", idle_setup); > > void show_regs(struct pt_regs * regs) > { >diff -rupN kernel-2.6.18/linux-2.6.18.noarch/arch/x86_64/kernel/process-xen.c kernel-2.6.18-patched/linux-2.6.18.noarch/arch/x86_64/kernel/process-xen.c >--- a/arch/x86_64/kernel/process-xen.c 2007-06-06 00:07:33.000000000 +0200 >+++ b/arch/x86_64/kernel/process-xen.c 2007-06-05 20:35:08.000000000 +0200 >@@ -111,8 +111,26 @@ void exit_idle(void) > __exit_idle(); > } > >-/* XXX XEN doesn't use default_idle(), poll_idle(). Use xen_idle() instead. */ >-void xen_idle(void) >+/* >+ * On SMP it's slightly faster (but much more power-consuming!) >+ * to poll the ->need_resched flag instead of waiting for the >+ * cross-CPU IPI to arrive. Use this option with caution. >+ */ >+static void poll_idle(void) >+{ >+ local_irq_enable(); >+ >+ asm volatile( >+ "2:" >+ "testl %0,%1;" >+ "rep; nop;" >+ "je 2b;" >+ : : >+ "i" (_TIF_NEED_RESCHED), >+ "m" (current_thread_info()->flags)); >+} >+ >+static void xen_idle(void) > { > local_irq_disable(); > >@@ -155,14 +173,18 @@ void cpu_idle (void) > /* endless idle loop with no priority at all */ > while (1) { > while (!need_resched()) { >+ void (*idle)(void); >+ > if (__get_cpu_var(cpu_idle_state)) > __get_cpu_var(cpu_idle_state) = 0; > rmb(); >- >+ idle = pm_idle; >+ if (!idle) >+ idle = xen_idle; > if (cpu_is_offline(smp_processor_id())) > play_dead(); > enter_idle(); >- xen_idle(); >+ idle(); > __exit_idle(); > } > >@@ -201,9 +223,22 @@ void cpu_idle_wait(void) > } > EXPORT_SYMBOL_GPL(cpu_idle_wait); > >-/* XXX XEN doesn't use mwait_idle(), select_idle_routine(), idle_setup(). */ >-/* Always use xen_idle() instead. */ >-void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) {} >+void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) >+{ >+} >+ >+static int __init idle_setup (char *str) >+{ >+ if (!strncmp(str, "poll", 4)) { >+ printk("using polling idle threads.\n"); >+ pm_idle = poll_idle; >+ } >+ >+ boot_option_idle_override = 1; >+ return 1; >+} >+ >+__setup("idle=", idle_setup); > > /* Prints also some state that isn't saved in the pt_regs */ > void __show_regs(struct pt_regs * regs)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 416141
: 281661