lkml.org 
[lkml]   [2016]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] nmi_backtrace: generate one-line reports for idle cpus
On Tue, Mar 01, 2016 at 11:01:42AM -0500, Chris Metcalf wrote:
> +++ b/kernel/sched/idle.c
> @@ -52,15 +52,25 @@ static int __init cpu_idle_nopoll_setup(char *__unused)
> __setup("hlt", cpu_idle_nopoll_setup);
> #endif
> +static DEFINE_PER_CPU(bool, cpu_idling);
> +
> +/* Was the cpu was in the low-level idle code when interrupted? */
> +bool in_cpu_idle(void)
> +{
> + return this_cpu_read(cpu_idling);
> +}
> +
> static inline int cpu_idle_poll(void)
> {
> rcu_idle_enter();
> trace_cpu_idle_rcuidle(0, smp_processor_id());
> local_irq_enable();
> stop_critical_timings();
> + this_cpu_write(cpu_idling, true);
> while (!tif_need_resched() &&
> (cpu_idle_force_poll || tick_check_broadcast_expired()))
> cpu_relax();
> + this_cpu_write(cpu_idling, false);
> start_critical_timings();
> trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
> rcu_idle_exit();
> @@ -89,7 +99,9 @@ void default_idle_call(void)
> local_irq_enable();
> } else {
> stop_critical_timings();
> + this_cpu_write(cpu_idling, true);
> arch_cpu_idle();
> + this_cpu_write(cpu_idling, false);
> start_critical_timings();
> }
> }

No, we're not going to add random crap here. This is actually considered
a fast path for some workloads.

There's already far too much fat in the whole going to idle and coming
out of idle. We should be trimming this, not adding to it.

\
 
 \ /
  Last update: 2016-03-07 11:21    [W:0.238 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site