From: Simon Horman <horms@verge.net.au>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Subject: [RFC] timers: Remove duplicate setting of new_base in __mod_timer()
Date: Thu, 17 Dec 2009 09:20:28 +1100 [thread overview]
Message-ID: <20091216222028.GA15841@verge.net.au> (raw)
Hi,
I am wondering if the first line of the following snippet of
__mod_timer() can be removed as new_base always seems to be reset.
Alternatively perhaps smp_processor_id() and per_cpu() could
be moved to inside the #if and the call to __get_cpu_var() moved to
inside #else ?
new_base = __get_cpu_var(tvec_bases);
cpu = smp_processor_id();
#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
if (!pinned && get_sysctl_timer_migration() && idle_cpu(cpu)) {
int preferred_cpu = get_nohz_load_balancer();
if (preferred_cpu >= 0)
cpu = preferred_cpu;
}
#endif
new_base = per_cpu(tvec_bases, cpu);
Signed-off-by: Simon Horman <horms@verge.net.au>
Index: linux-2.6/kernel/timer.c
===================================================================
--- linux-2.6.orig/kernel/timer.c 2009-12-17 07:02:57.000000000 +0900
+++ linux-2.6/kernel/timer.c 2009-12-17 07:03:17.000000000 +0900
@@ -656,8 +656,6 @@ __mod_timer(struct timer_list *timer, un
debug_activate(timer, expires);
- new_base = __get_cpu_var(tvec_bases);
-
cpu = smp_processor_id();
#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
next reply other threads:[~2009-12-16 22:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 22:20 Simon Horman [this message]
2009-12-16 23:58 ` Thomas Gleixner
2009-12-17 0:07 ` Simon Horman
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=20091216222028.GA15841@verge.net.au \
--to=horms@verge.net.au \
--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®