From: Frederic Weisbecker <fweisbec@gmail.com>
To: Don Zickus <dzickus@redhat.com>
Cc: mingo@elte.hu, peterz@infradead.org, gorcunov@gmail.com,
aris@redhat.com, linux-kernel@vger.kernel.org,
randy.dunlap@oracle.com
Subject: Re: [PATCH 1/6] [watchdog] combine nmi_watchdog and softlockup
Date: Wed, 21 Apr 2010 19:27:33 +0200 [thread overview]
Message-ID: <20100421172730.GD5650@nowhere> (raw)
In-Reply-To: <1271777043-3807-2-git-send-email-dzickus@redhat.com>
Some minor things:
On Tue, Apr 20, 2010 at 11:23:58AM -0400, Don Zickus wrote:
> +#ifdef CONFIG_PERF_EVENTS_NMI
> +struct perf_event_attr wd_hw_attr = {
> + .type = PERF_TYPE_HARDWARE,
> + .config = PERF_COUNT_HW_CPU_CYCLES,
> + .size = sizeof(struct perf_event_attr),
> + .pinned = 1,
> + .disabled = 1,
> +};
Shouldn't it be static?
> +
> +/* Callback function for perf event subsystem */
> +void watchdog_overflow_callback(struct perf_event *event, int nmi,
> + struct perf_sample_data *data,
> + struct pt_regs *regs)
> +{
> + int this_cpu = smp_processor_id();
> + unsigned long touch_ts = per_cpu(watchdog_touch_ts, this_cpu);
> + char warn = per_cpu(watchdog_warn, this_cpu);
You can use __get_cpu_var() here
> +
> + if (touch_ts == 0) {
> + __touch_watchdog();
> + return;
> + }
> +
> + /* check for a hardlockup
> + * This is done by making sure our timer interrupt
> + * is incrementing. The timer interrupt should have
> + * fired multiple times before we overflow'd. If it hasn't
> + * then this is a good indication the cpu is stuck
> + */
> + if (is_hardlockup(this_cpu)) {
> + /* only print hardlockups once */
> + if (warn & HARDLOCKUP)
> + return;
> +
> + if (hardlockup_panic)
> + panic("Watchdog detected hard LOCKUP on cpu %d", this_cpu);
> + else
> + WARN(1, "Watchdog detected hard LOCKUP on cpu %d", this_cpu);
> +
> + per_cpu(watchdog_warn, this_cpu) = warn | HARDLOCKUP;
and here.
> + return;
> + }
> +
> + per_cpu(watchdog_warn, this_cpu) = warn & ~HARDLOCKUP;
> + return;
> +}
> +static void watchdog_interrupt_count(void)
> +{
> + __get_cpu_var(hrtimer_interrupts)++;
> +}
> +#else
> +static void watchdog_interrupt_count(void) { return; }
Off case should be inline (although gcc will probably inline it by itself)
> +#endif /* CONFIG_PERF_EVENTS_NMI */
> +
> +/* watchdog kicker functions */
> +static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
> +{
> + int this_cpu = smp_processor_id();
> + unsigned long touch_ts = per_cpu(watchdog_touch_ts, this_cpu);
__get_cpu_var
next prev parent reply other threads:[~2010-04-21 17:27 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 [this message]
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 ` [PATCH 7/6] [watchdog] resolve softlockup.c conflicts Don Zickus
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=20100421172730.GD5650@nowhere \
--to=fweisbec@gmail.com \
--cc=aris@redhat.com \
--cc=dzickus@redhat.com \
--cc=gorcunov@gmail.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