lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 30 Sep 2006 01:45:24 -0700
From:	Andrew Morton <akpm@...l.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Jim Gettys <jg@...top.org>, John Stultz <johnstul@...ibm.com>,
	David Woodhouse <dwmw2@...radead.org>,
	Arjan van de Ven <arjan@...radead.org>,
	Dave Jones <davej@...hat.com>
Subject: Re: [patch 18/23] dynticks: i386 arch code

On Fri, 29 Sep 2006 23:58:37 -0000
Thomas Gleixner <tglx@...utronix.de> wrote:

> From: Ingo Molnar <mingo@...e.hu>
> 
> 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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ