Skip to contentSkip to conversation

watchdog: Add warning message when the newcpumask contains nohz_full cores

PATCH In review Zqiang 1 participant 2 messages Nov 18, 2021 – Nov 22, 2021

lore
Share & tools
lore

Zqiang

author
#0 lore raw

PATCH v3 1/1 watchdog: Add warning message when the newcpumask contains nohz_full cores

The watchdog default is disabled on nohz_full cores, however when override the cpumask, if new cpumask contains nohz_full cores, add warning message.

---
v1->v2:
if watchdog_cpumask became empty, set housekeeping_cpumask. v2->v3:
only print a warning when a nohz_full CPU is included in new cpumask.

 kernel/watchdog.c | 1 +
 1 file changed, 1 insertion(+)
kernel/watchdog.c +1 -0
index ad912511a0c0..37a978d8ff06 100644
@@ -629,6 +629,7 @@ static void proc_watchdog_update(void)
 {
 	/* Remove impossible cpus to keep sysctl output clean. */
 	cpumask_and(&watchdog_cpumask, &watchdog_cpumask, cpu_possible_mask);
+	WARN_ONCE(!cpumask_subset(&watchdog_cpumask, housekeeping_cpumask(HK_FLAG_TIMER)), "Enabling watchdog on nohz_full cores\n");
 	lockup_detector_reconfigure();
 }
 
Signature · 1 line
2.17.1
author
#1 lore raw
Quoted 19 lines · Zqiang

The watchdog default is disabled on nohz_full cores, however when override the cpumask, if new cpumask contains nohz_full cores, add warning message.

---
v1->v2:
if watchdog_cpumask became empty, set housekeeping_cpumask. v2->v3:
only print a warning when a nohz_full CPU is included in new cpumask.

  kernel/watchdog.c | 1 +
  1 file changed, 1 insertion(+)
kernel/watchdog.c +0 -0
index ad912511a0c0..37a978d8ff06 100644

kernel/watchdog.c static void proc_watchdog_update(void) · line 635

Quoted 7 lines
kernel/watchdog.c +1 -0
@@ -629,6 +629,7 @@ static void proc_watchdog_update(void)
  {
  	/* Remove impossible cpus to keep sysctl output clean. */
  	cpumask_and(&watchdog_cpumask, &watchdog_cpumask, cpu_possible_mask);
+	WARN_ONCE(!cpumask_subset(&watchdog_cpumask, housekeeping_cpumask(HK_FLAG_TIMER)), "Enabling watchdog on nohz_full cores\n");
  	lockup_detector_reconfigure();
  }
 

Hello Frederic

Can you give some suggestions?

Thanks

Zqiang