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]
Message-Id: <20070625171115.73a42e93.akpm@linux-foundation.org>
Date:	Mon, 25 Jun 2007 17:11:15 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	Andi Kleen <ak@...e.de>, Ingo Molnar <mingo@...e.hu>,
	Arjan van de Ven <arjan@...radead.org>,
	Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>,
	John Stultz <johnstul@...ibm.com>,
	Chris Wright <chrisw@...s-sol.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [patch -mm 09/28] Tick management: spread timer interrupt

On Sat, 23 Jun 2007 13:32:34 -0000
Thomas Gleixner <tglx@...utronix.de> wrote:

> From: john stultz <johnstul@...ibm.com>
> 
> After discussing w/ Thomas over IRC, it seems the issue is the sched
> tick fires on every cpu at the same time, causing extra lock contention.
> 
> This smaller change, adds an extra offset per cpu so the ticks don't
> line up. This patch also drops the idle latency from 40us down to under
> 20us.
> 
> Signed-off-by: john stultz <johnstul@...ibm.com>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> 
> ---
>  kernel/time/tick-sched.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> Index: linux-2.6.22-rc4-mm/kernel/time/tick-sched.c
> ===================================================================
> --- linux-2.6.22-rc4-mm.orig/kernel/time/tick-sched.c	2007-06-23 14:38:56.000000000 +0200
> +++ linux-2.6.22-rc4-mm/kernel/time/tick-sched.c	2007-06-23 14:38:58.000000000 +0200
> @@ -573,6 +573,7 @@ void tick_setup_sched_timer(void)
>  {
>  	struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
>  	ktime_t now = ktime_get();
> +	u64 offset;
>  
>  	/*
>  	 * Emulate tick processing via per-CPU hrtimers:
> @@ -581,8 +582,12 @@ void tick_setup_sched_timer(void)
>  	ts->sched_timer.function = tick_sched_timer;
>  	ts->sched_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ;
>  
> -	/* Get the next period */
> +	/* Get the next period (per cpu) */
>  	ts->sched_timer.expires = tick_init_jiffy_update();
> +	offset = ktime_to_ns(tick_period) >> 1;
> +	do_div(offset, NR_CPUS);

With CONFIG_NR_CPUS=128 on a 2-way this'll be a pretty lumpy spreading? 
Perhaps it woud be better to use num_possible_cpus() here?


> +	offset *= smp_processor_id();
> +	ts->sched_timer.expires = ktime_add_ns(ts->sched_timer.expires, offset);
>  
>  	for (;;) {
>  		hrtimer_forward(&ts->sched_timer, now, tick_period);
> 
> -- 
-
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