Re: [patch 18/23] dynticks: i386 arch code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 29 Sep 2006 23:58:37 -0000
Thomas Gleixner <[email protected]> wrote:

> From: Ingo Molnar <[email protected]>
> 
> prepare i386 for dyntick: idle handler callbacks and IRQ callback.
> 
> Index: linux-2.6.18-mm2/arch/i386/kernel/nmi.c
> ===================================================================
> --- linux-2.6.18-mm2.orig/arch/i386/kernel/nmi.c	2006-09-30 01:41:10.000000000 +0200
> +++ linux-2.6.18-mm2/arch/i386/kernel/nmi.c	2006-09-30 01:41:19.000000000 +0200
> @@ -20,6 +20,7 @@
>  #include <linux/sysdev.h>
>  #include <linux/sysctl.h>
>  #include <linux/percpu.h>
> +#include <linux/kernel_stat.h>
>  #include <linux/dmi.h>
>  #include <linux/kprobes.h>
>  
> @@ -908,7 +909,7 @@ __kprobes int nmi_watchdog_tick(struct p
>  		touched = 1;
>  	}
>  
> -	sum = per_cpu(irq_stat, cpu).apic_timer_irqs;
> +	sum = per_cpu(irq_stat, cpu).apic_timer_irqs + kstat_irqs(0);

Why?

> ===================================================================
> --- linux-2.6.18-mm2.orig/arch/i386/kernel/process.c	2006-09-30 01:41:10.000000000 +0200
> +++ linux-2.6.18-mm2/arch/i386/kernel/process.c	2006-09-30 01:41:19.000000000 +0200
> @@ -178,24 +178,27 @@ void cpu_idle(void)
>  
>  	/* endless idle loop with no priority at all */
>  	while (1) {
> -		while (!need_resched()) {
> -			void (*idle)(void);
> +		if (!hrtimer_stop_sched_tick()) {
> +			while (!need_resched()) {

I don't see why hrtimer_stop_sched_tick() returns need_resched().  We
immediately reevaluate it anyway.  hrtimer_stop_sched_tick() could return 1.

> +				void (*idle)(void);
>  
> -			if (__get_cpu_var(cpu_idle_state))
> -				__get_cpu_var(cpu_idle_state) = 0;
> +				if (__get_cpu_var(cpu_idle_state))
> +					__get_cpu_var(cpu_idle_state) = 0;
>  
> -			rmb();
> -			idle = pm_idle;
> +				rmb();
> +				idle = pm_idle;
>  
> -			if (!idle)
> -				idle = default_idle;
> +				if (!idle)
> +					idle = default_idle;
>  
> -			if (cpu_is_offline(cpu))
> -				play_dead();
> +				if (cpu_is_offline(cpu))
> +					play_dead();
>  
> -			__get_cpu_var(irq_stat).idle_timestamp = jiffies;
> -			idle();
> +				__get_cpu_var(irq_stat).idle_timestamp = jiffies;
> +				idle();
> +			}
>  		}
> +		hrtimer_restart_sched_tick();
>  		preempt_enable_no_resched();
>  		schedule();
>  		preempt_disable();
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux