From: Miao Xie <miaox@cn.fujitsu.com>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] time: add an offline-cpu check in add_timer_on()
Date: Fri, 14 Dec 2007 18:31:48 +0800 [thread overview]
Message-ID: <47625B94.50105@cn.fujitsu.com> (raw)
Hi everyone,
I think we need a check in the function add_timer_on() to avoid adding a
timer into the timer list of an offline cpu.
This patch fixes this problem in add_timer_on().
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
kernel/timer.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/timer.c b/kernel/timer.c
index a05817c..6189561 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -451,6 +451,7 @@ void add_timer_on(struct timer_list *timer, int cpu)
timer_stats_timer_set_start_info(timer);
BUG_ON(timer_pending(timer) || !timer->function);
spin_lock_irqsave(&base->lock, flags);
+ BUG_ON(cpu_is_offline(cpu));
timer_set_base(timer, base);
internal_add_timer(base, timer);
spin_unlock_irqrestore(&base->lock, flags);
--
1.5.3.7
next reply other threads:[~2007-12-14 10:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-14 10:31 Miao Xie [this message]
2007-12-14 10:56 ` Andi Kleen
2007-12-14 11:05 ` Thomas Gleixner
2007-12-14 11:03 ` Thomas Gleixner
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=47625B94.50105@cn.fujitsu.com \
--to=miaox@cn.fujitsu.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®