From: Don Zickus <dzickus@redhat.com>
To: mingo@elte.hu, fweisbec@gmail.com
Cc: peterz@infradead.org, gorcunov@gmail.com, aris@redhat.com,
linux-kernel@vger.kernel.org, randy.dunlap@oracle.com,
dzickus@redhat.com, colin.king@canonical.com,
jason.wessel@windriver.com
Subject: [PATCH 7/6] [watchdog] resolve softlockup.c conflicts
Date: Tue, 20 Apr 2010 12:16:41 -0400 [thread overview]
Message-ID: <1271780201-19163-1-git-send-email-dzickus@redhat.com> (raw)
In-Reply-To: <1271777043-3807-1-git-send-email-dzickus@redhat.com>
My changes with the softlockup code uses an older version of softlockup.c.
A couple of commits have been committed that were not on the branch I am
using. This patch resolves those conflicts.
Commit 8c2eb4 softlockup: Stop spurious softlockup messages due to overflow
d6ad3e softlockup: Add sched_clock_tick() to avoid kernel warning on kgdb resume
Conflicts:
include/linux/sched.h
kernel/kgdb.c
kernel/softlockup.c
Signed-off-by: Don Zickus <dzickus@redhat.com>
--
Hi Ingo,
If there is a better way to deal with these conflicts please let me know.
---
include/linux/sched.h | 4 ++++
kernel/kgdb.c | 6 +++---
kernel/watchdog.c | 17 ++++++++++++++++-
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0c128ad..e039e22 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -310,6 +310,7 @@ extern void sched_show_task(struct task_struct *p);
#ifdef CONFIG_LOCKUP_DETECTOR
extern void touch_watchdog(void);
extern void touch_all_watchdogs(void);
+extern void touch_watchdog_sync(void);
extern unsigned int softlockup_panic;
extern int softlockup_thresh;
extern int proc_dowatchdog_thresh(struct ctl_table *table, int write,
@@ -322,6 +323,9 @@ static inline void touch_watchdog(void)
static inline void touch_all_watchdogs(void)
{
}
+static inline void touch_watchdog_sync(void)
+{
+}
#endif
#ifdef CONFIG_DETECT_HUNG_TASK
diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index 15df969..da98119 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -596,7 +596,7 @@ static void kgdb_wait(struct pt_regs *regs)
/* Signal the primary CPU that we are done: */
atomic_set(&cpu_in_kgdb[cpu], 0);
- touch_watchdog();
+ touch_watchdog_sync();
clocksource_touch_watchdog();
local_irq_restore(flags);
}
@@ -1450,7 +1450,7 @@ acquirelock:
(kgdb_info[cpu].task &&
kgdb_info[cpu].task->pid != kgdb_sstep_pid) && --sstep_tries) {
atomic_set(&kgdb_active, -1);
- touch_watchdog();
+ touch_watchdog_sync();
clocksource_touch_watchdog();
local_irq_restore(flags);
@@ -1550,7 +1550,7 @@ kgdb_restore:
}
/* Free kgdb_active */
atomic_set(&kgdb_active, -1);
- touch_watchdog();
+ touch_watchdog_sync();
clocksource_touch_watchdog();
local_irq_restore(flags);
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 73529a8..9898c7c 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -33,6 +33,7 @@ int __read_mostly softlockup_thresh = 60;
static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts);
static DEFINE_PER_CPU(struct task_struct *, softlockup_watchdog);
static DEFINE_PER_CPU(struct hrtimer, watchdog_hrtimer);
+static DEFINE_PER_CPU(bool, watchdog_touch_sync);
#define HARDLOCKUP 1
#define SOFTLOCKUP 2
static DEFINE_PER_CPU(char, watchdog_warn);
@@ -138,6 +139,12 @@ void touch_all_watchdogs(void)
per_cpu(watchdog_touch_ts, cpu) = 0;
}
+void touch_watchdog_sync(void)
+{
+ __raw_get_cpu_var(watchdog_touch_sync) = true;
+ __raw_get_cpu_var(watchdog_touch_ts) = 0;
+}
+
void touch_nmi_watchdog(void)
{
touch_watchdog();
@@ -163,7 +170,7 @@ static int is_softlockup(unsigned long touch_ts, int cpu)
unsigned long now = get_timestamp(cpu);
/* Warn about unreasonable delays: */
- if (now > (touch_ts + softlockup_thresh))
+ if (time_after(now, touch_ts + softlockup_thresh))
return now - touch_ts;
return 0;
@@ -254,6 +261,14 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
hrtimer_forward_now(hrtimer, ns_to_ktime(get_sample_period()));
if (touch_ts == 0) {
+ if (unlikely(per_cpu(watchdog_touch_sync, this_cpu))) {
+ /*
+ * If the time stamp was touched atomically
+ * make sure the scheduler tick is up to date.
+ */
+ per_cpu(watchdog_touch_sync, this_cpu) = false;
+ sched_clock_tick();
+ }
__touch_watchdog();
return HRTIMER_RESTART;
}
--
1.6.5.2
prev parent reply other threads:[~2010-04-20 16:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-20 15:23 [PATCH 0/6] lockup detector changes Don Zickus
2010-04-20 15:23 ` [PATCH 1/6] [watchdog] combine nmi_watchdog and softlockup Don Zickus
2010-04-20 15:53 ` Randy Dunlap
2010-04-20 16:11 ` Don Zickus
2010-04-21 17:27 ` Frederic Weisbecker
2010-04-21 17:50 ` Don Zickus
2010-04-21 20:24 ` Frederic Weisbecker
2010-04-21 20:49 ` Don Zickus
2010-04-20 15:23 ` [PATCH 2/6] [watchdog] convert touch_softlockup_watchdog to touch_watchdog Don Zickus
2010-04-21 20:46 ` Frederic Weisbecker
2010-04-21 21:31 ` Don Zickus
2010-04-21 21:46 ` Frederic Weisbecker
2010-04-22 13:20 ` Don Zickus
2010-04-22 18:53 ` Frederic Weisbecker
2010-04-20 15:24 ` [PATCH 3/6] [watchdog] remove old softlockup code Don Zickus
2010-04-20 15:24 ` [PATCH 4/6] [watchdog] remove nmi_watchdog.c file Don Zickus
2010-04-20 15:24 ` [PATCH 5/6] [x86] watchdog: move trigger_all_cpu_backtrace to its own die_notifier Don Zickus
2010-04-21 21:00 ` Frederic Weisbecker
2010-04-21 21:10 ` Don Zickus
2010-04-21 21:34 ` Frederic Weisbecker
2010-04-20 15:24 ` [PATCH 6/6] [x86] watchdog: cleanup hw_nmi.c cruft Don Zickus
2010-04-20 16:16 ` Don Zickus [this message]
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=1271780201-19163-1-git-send-email-dzickus@redhat.com \
--to=dzickus@redhat.com \
--cc=aris@redhat.com \
--cc=colin.king@canonical.com \
--cc=fweisbec@gmail.com \
--cc=gorcunov@gmail.com \
--cc=jason.wessel@windriver.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=randy.dunlap@oracle.com \
/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®