File tree 2 files changed +21
-6
lines changed
2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,6 @@ EXPORT_SYMBOL(arch_touch_nmi_watchdog);
109
109
void watchdog_hardlockup_touch_cpu (unsigned int cpu )
110
110
{
111
111
per_cpu (watchdog_hardlockup_touched , cpu ) = true;
112
-
113
- /* Match with smp_rmb() in watchdog_hardlockup_check() */
114
- smp_wmb ();
115
112
}
116
113
117
114
static bool is_hardlockup (unsigned int cpu )
@@ -141,9 +138,6 @@ static void watchdog_hardlockup_kick(void)
141
138
142
139
void watchdog_hardlockup_check (unsigned int cpu , struct pt_regs * regs )
143
140
{
144
- /* Match with smp_wmb() in watchdog_hardlockup_touch_cpu() */
145
- smp_rmb ();
146
-
147
141
if (per_cpu (watchdog_hardlockup_touched , cpu )) {
148
142
per_cpu (watchdog_hardlockup_touched , cpu ) = false;
149
143
return ;
Original file line number Diff line number Diff line change @@ -51,6 +51,13 @@ void watchdog_hardlockup_enable(unsigned int cpu)
51
51
if (next_cpu < nr_cpu_ids )
52
52
watchdog_hardlockup_touch_cpu (next_cpu );
53
53
54
+ /*
55
+ * Makes sure that watchdog is touched on this CPU before
56
+ * other CPUs could see it in watchdog_cpus. The counter
57
+ * part is in watchdog_buddy_check_hardlockup().
58
+ */
59
+ smp_wmb ();
60
+
54
61
cpumask_set_cpu (cpu , & watchdog_cpus );
55
62
}
56
63
@@ -68,6 +75,13 @@ void watchdog_hardlockup_disable(unsigned int cpu)
68
75
if (next_cpu < nr_cpu_ids )
69
76
watchdog_hardlockup_touch_cpu (next_cpu );
70
77
78
+ /*
79
+ * Makes sure that watchdog is touched on the next CPU before
80
+ * this CPU disappear in watchdog_cpus. The counter part is in
81
+ * watchdog_buddy_check_hardlockup().
82
+ */
83
+ smp_wmb ();
84
+
71
85
cpumask_clear_cpu (cpu , & watchdog_cpus );
72
86
}
73
87
@@ -88,5 +102,12 @@ void watchdog_buddy_check_hardlockup(int hrtimer_interrupts)
88
102
if (next_cpu >= nr_cpu_ids )
89
103
return ;
90
104
105
+ /*
106
+ * Make sure that the watchdog was touched on next CPU when
107
+ * watchdog_next_cpu() returned another one because of
108
+ * a change in watchdog_hardlockup_enable()/disable().
109
+ */
110
+ smp_rmb ();
111
+
91
112
watchdog_hardlockup_check (next_cpu , NULL );
92
113
}
You can’t perform that action at this time.
0 commit comments