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: <20100924193447.GT26290@redhat.com>
Date:	Fri, 24 Sep 2010 15:34:47 -0400
From:	Don Zickus <dzickus@...hat.com>
To:	Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Cyrill Gorcunov <gorcunov@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH] avoid second smp_processor_id() call in __touch_watchdog

On Wed, Sep 22, 2010 at 12:00:12PM +0300, Sergey Senozhatsky wrote:
> Hello,
> 
> Per our previous conversation:
> 
> Andrew Morton wrote:
> > Fair enough, although strictly speaking this should be done in a
> > separate and later patch.
> > 
> 
> 
> Avoid double smp_processor_id() call in __touch_watchdog (smp_processor_id() 
> itself and later call in __get_cpu_var())

Dropping this patch then based on Peter's and Frederic's feedback that the
compiler probably already optimizes for this, leaving readability as a good
excuse not to change anything.

Cheers,
Don

> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
> 
> ---
> 
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index 7f9c3c5..03d97c5 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -116,8 +116,7 @@ static unsigned long get_sample_period(void)
>  static void __touch_watchdog(void)
>  {
>  	int this_cpu = smp_processor_id();
> -
> -	__get_cpu_var(watchdog_touch_ts) = get_timestamp(this_cpu);
> +	per_cpu(watchdog_touch_ts, this_cpu) = get_timestamp(this_cpu);
>  }
>  
>  void touch_softlockup_watchdog(void)
> 
--
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