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:	Thu, 31 Jan 2008 16:21:59 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Guillaume Chazarain <guichaz@...oo.fr>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] x86: remove unused code in set_cyc2ns_scale()


* Guillaume Chazarain <guichaz@...oo.fr> wrote:

>  arch/x86/kernel/tsc_32.c |   14 +++++---------
>  arch/x86/kernel/tsc_64.c |   14 +++++---------
>  2 files changed, 10 insertions(+), 18 deletions(-)

>  static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu)
>  {
> -	unsigned long flags, prev_scale, *scale;
> -	unsigned long long tsc_now, ns_now;
> +	unsigned long flags, *scale;
> +
> +	if (!cpu_khz)
> +		return;
>  
>  	local_irq_save(flags);
>  	sched_clock_idle_sleep_event();
>  
>  	scale = &per_cpu(cyc2ns, cpu);
> -
> -	rdtscll(tsc_now);
> -	ns_now = __cycles_2_ns(tsc_now);
> -
> -	prev_scale = *scale;
> -	if (cpu_khz)
> -		*scale = (NSEC_PER_MSEC << CYC2NS_SCALE_FACTOR)/cpu_khz;
> +	*scale = (NSEC_PER_MSEC << CYC2NS_SCALE_FACTOR)/cpu_khz;

hm, this is not a pure elimination of dead code, this will change 
behavior. For example we wont call sched_clock_idle_sleep_event() on 
!cpu_khz now. Hm?

	Ingo
--
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