Lines Matching +full:cpu +full:- +full:3

1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/cpu.h>
7 #include <linux/percpu-defs.h>
11 static unsigned int watchdog_next_cpu(unsigned int cpu) in watchdog_next_cpu() argument
15 next_cpu = cpumask_next(cpu, &watchdog_cpus); in watchdog_next_cpu()
19 if (next_cpu == cpu) in watchdog_next_cpu()
30 void watchdog_hardlockup_enable(unsigned int cpu) in watchdog_hardlockup_enable() argument
35 * The new CPU will be marked online before the hrtimer interrupt in watchdog_hardlockup_enable()
36 * gets a chance to run on it. If another CPU tests for a in watchdog_hardlockup_enable()
37 * hardlockup on the new CPU before it has run its the hrtimer in watchdog_hardlockup_enable()
39 * the new CPU to delay the check for at least 3 sampling periods in watchdog_hardlockup_enable()
40 * to guarantee one hrtimer has run on the new CPU. in watchdog_hardlockup_enable()
42 watchdog_hardlockup_touch_cpu(cpu); in watchdog_hardlockup_enable()
45 * We are going to check the next CPU. Our watchdog_hrtimer in watchdog_hardlockup_enable()
46 * need not be zero if the CPU has already been online earlier. in watchdog_hardlockup_enable()
47 * Touch the watchdog on the next CPU to avoid false positive in watchdog_hardlockup_enable()
48 * if we try to check it in less then 3 interrupts. in watchdog_hardlockup_enable()
50 next_cpu = watchdog_next_cpu(cpu); in watchdog_hardlockup_enable()
55 * Makes sure that watchdog is touched on this CPU before in watchdog_hardlockup_enable()
61 cpumask_set_cpu(cpu, &watchdog_cpus); in watchdog_hardlockup_enable()
64 void watchdog_hardlockup_disable(unsigned int cpu) in watchdog_hardlockup_disable() argument
66 unsigned int next_cpu = watchdog_next_cpu(cpu); in watchdog_hardlockup_disable()
69 * Offlining this CPU will cause the CPU before this one to start in watchdog_hardlockup_disable()
70 * checking the one after this one. If this CPU just finished checking in watchdog_hardlockup_disable()
71 * the next CPU and updating hrtimer_interrupts_saved, and then the in watchdog_hardlockup_disable()
72 * previous CPU checks it within one sample period, it will trigger a in watchdog_hardlockup_disable()
73 * false positive. Touch the watchdog on the next CPU to prevent it. in watchdog_hardlockup_disable()
79 * Makes sure that watchdog is touched on the next CPU before in watchdog_hardlockup_disable()
80 * this CPU disappear in watchdog_cpus. The counter part is in in watchdog_hardlockup_disable()
85 cpumask_clear_cpu(cpu, &watchdog_cpus); in watchdog_hardlockup_disable()
93 * Test for hardlockups every 3 samples. The sample period is in watchdog_buddy_check_hardlockup()
94 * watchdog_thresh * 2 / 5, so 3 samples gets us back to slightly over in watchdog_buddy_check_hardlockup()
97 if (hrtimer_interrupts % 3 != 0) in watchdog_buddy_check_hardlockup()
100 /* check for a hardlockup on the next CPU */ in watchdog_buddy_check_hardlockup()
106 * Make sure that the watchdog was touched on next CPU when in watchdog_buddy_check_hardlockup()