Skip to content

Commit cb9d7fd

Browse files
vwaxKAGA-KOKO
authored andcommitted
watchdog: Mark watchdog touch functions as notrace
Some architectures need to use stop_machine() to patch functions for ftrace, and the assumption is that the stopped CPUs do not make function calls to traceable functions when they are in the stopped state. Commit ce4f06d ("stop_machine: Touch_nmi_watchdog() after MULTI_STOP_PREPARE") added calls to the watchdog touch functions from the stopped CPUs and those functions lack notrace annotations. This leads to crashes when enabling/disabling ftrace on ARM kernels built with the Thumb-2 instruction set. Fix it by adding the necessary notrace annotations. Fixes: ce4f06d ("stop_machine: Touch_nmi_watchdog() after MULTI_STOP_PREPARE") Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: oleg@redhat.com Cc: tj@kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180821152507.18313-1-vincent.whitchurch@axis.com
1 parent 5b394b2 commit cb9d7fd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

kernel/watchdog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static void __touch_watchdog(void)
261261
* entering idle state. This should only be used for scheduler events.
262262
* Use touch_softlockup_watchdog() for everything else.
263263
*/
264-
void touch_softlockup_watchdog_sched(void)
264+
notrace void touch_softlockup_watchdog_sched(void)
265265
{
266266
/*
267267
* Preemption can be enabled. It doesn't matter which CPU's timestamp
@@ -270,7 +270,7 @@ void touch_softlockup_watchdog_sched(void)
270270
raw_cpu_write(watchdog_touch_ts, 0);
271271
}
272272

273-
void touch_softlockup_watchdog(void)
273+
notrace void touch_softlockup_watchdog(void)
274274
{
275275
touch_softlockup_watchdog_sched();
276276
wq_watchdog_touch(raw_smp_processor_id());

kernel/watchdog_hld.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static struct cpumask dead_events_mask;
2929
static unsigned long hardlockup_allcpu_dumped;
3030
static atomic_t watchdog_cpus = ATOMIC_INIT(0);
3131

32-
void arch_touch_nmi_watchdog(void)
32+
notrace void arch_touch_nmi_watchdog(void)
3333
{
3434
/*
3535
* Using __raw here because some code paths have

kernel/workqueue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5574,7 +5574,7 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
55745574
mod_timer(&wq_watchdog_timer, jiffies + thresh);
55755575
}
55765576

5577-
void wq_watchdog_touch(int cpu)
5577+
notrace void wq_watchdog_touch(int cpu)
55785578
{
55795579
if (cpu >= 0)
55805580
per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies;

0 commit comments

Comments
 (0)