Skip to contentSkip to conversation

Added comments to explain watchdog_disabled variable

PATCH In review anish kumar 2 participants 3 messages Feb 1, 2013 – Feb 2, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Added comments to explain watchdog_disabled variable

From: anish kumar <[email protected]>

This watchdog_disabled flag is bit of cryptic.Howerver it's usefullnes is multifold. Uses are:
1. Check if smpboot_register_percpu_thread function passed.
2. Makes sure that user enables and disables the watchdog in sequence i.e. enable watchdog->disable watchdog->enable watchdog
Unlike enable watchdog->enable watchdog which is wrong.

---
 kernel/watchdog.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
kernel/watchdog.c +5 -0
index 6ef638b..dfd843a 100644
@@ -519,6 +519,11 @@ int proc_dowatchdog(struct ctl_table *table, int write,
 		return ret;
 
 	set_sample_period();
+	/*
+	 * We shouldn't enable watchdog threads if it is not
+	 * disabled.This is done by watchdog_disabled
+	 * variable check in watchdog_*_all_cpus function.
+	 */
 	if (watchdog_enabled && watchdog_thresh)
 		watchdog_enable_all_cpus();
 	else
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · anish kumar

From: anish kumar <[email protected]>

This watchdog_disabled flag is bit of cryptic.Howerver it's usefullnes is multifold. Uses are:
1. Check if smpboot_register_percpu_thread function passed.
2. Makes sure that user enables and disables the watchdog in sequence i.e. enable watchdog->disable watchdog->enable watchdog
Unlike enable watchdog->enable watchdog which is wrong.

---
 kernel/watchdog.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
kernel/watchdog.c +0 -0
index 6ef638b..dfd843a 100644

kernel/watchdog.c int proc_dowatchdog(struct ctl_table *table, int write, · line 523

Quoted 5 lines
kernel/watchdog.c +2 -0
@@ -519,6 +519,11 @@ int proc_dowatchdog(struct ctl_table *table, int write,
 		return ret;
 
 	set_sample_period();
+	/*
+	 * We shouldn't enable watchdog threads if it is not
							^^^

the 'not' is not needed I believe. Other than that, if it helps to understand the code better. I am fine with it.

Quoted 9 lines
kernel/watchdog.c +3 -0
+	 * disabled.This is done by watchdog_disabled
+	 * variable check in watchdog_*_all_cpus function.
+	 */
 	if (watchdog_enabled && watchdog_thresh)
 		watchdog_enable_all_cpus();
 	else
Signature · 1 line
1.7.1
#2 lore raw
Quoted 22 lines · Don Zickus
Quoted 21 lines · anish kumar

From: anish kumar <[email protected]>

This watchdog_disabled flag is bit of cryptic.Howerver it's usefullnes is multifold. Uses are:
1. Check if smpboot_register_percpu_thread function passed.
2. Makes sure that user enables and disables the watchdog in sequence i.e. enable watchdog->disable watchdog->enable watchdog
Unlike enable watchdog->enable watchdog which is wrong.

---
 kernel/watchdog.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
kernel/watchdog.c +0 -0
index 6ef638b..dfd843a 100644
@@ -519,6 +519,11 @@ int proc_dowatchdog(struct ctl_table *table, int write,
 		return ret;
 
Quoted 8 lines

kernel/watchdog.c int proc_dowatchdog(struct ctl_table *table, int write, · line 523

Quoted 3 lines
kernel/watchdog.c +2 -0
 	set_sample_period();
+	/*
+	 * We shouldn't enable watchdog threads if it is not
							^^^

the 'not' is not needed I believe. Other than that, if it helps to understand the code better. I am fine with it.

Should I wait for some more acked-by's?

Quoted 10 lines
Quoted 10 lines
kernel/watchdog.c +3 -0
+	 * disabled.This is done by watchdog_disabled
+	 * variable check in watchdog_*_all_cpus function.
+	 */
 	if (watchdog_enabled && watchdog_thresh)
 		watchdog_enable_all_cpus();
 	else
Signature · 1 line
1.7.1