From: Ingo Molnar <mingo@elte.hu>
To: Guillaume Chazarain <guichaz@yahoo.fr>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] x86: remove unused code in set_cyc2ns_scale()
Date: Thu, 31 Jan 2008 16:21:59 +0100 [thread overview]
Message-ID: <20080131152158.GB26963@elte.hu> (raw)
In-Reply-To: <1201641301-9288-1-git-send-email-guichaz@yahoo.fr>
* Guillaume Chazarain <guichaz@yahoo.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
next prev parent reply other threads:[~2008-01-31 15:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-29 21:15 Guillaume Chazarain
2008-01-31 15:21 ` Ingo Molnar [this message]
2008-01-31 19:18 ` Guillaume Chazarain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080131152158.GB26963@elte.hu \
--to=mingo@elte.hu \
--cc=guichaz@yahoo.fr \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®