All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Fernando Luis Vázquez Cao" <fernando@oss.ntt.co.jp>
To: Don Zickus <dzickus@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] watchdog: fix code/comments mismatches
Date: Thu, 09 Feb 2012 12:04:20 +0900	[thread overview]
Message-ID: <4F3337B4.3010102@oss.ntt.co.jp> (raw)
In-Reply-To: <4F332475.10603@oss.ntt.co.jp>

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]

Hi Don,

This is the last of the documentation fixes.
I am preparing some bug fixes now.

Thanks,
Fernando

[-- Attachment #2: watchdog-ccomments.patch --]
[-- Type: text/x-patch, Size: 2536 bytes --]

Subject: [PATCH] watchdog: fix code/comments mismatches

From: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>

Reflect the change in the soft and hard lockup thresholds and their relation to
the frequency of the hrtimer and NMI events in the code comments. While at it,
remove references to files that do not exist anymore.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---

diff -urNp linux-3.2.5-orig/kernel/watchdog.c linux-3.2.5/kernel/watchdog.c
--- linux-3.2.5-orig/kernel/watchdog.c	2012-01-05 08:55:44.000000000 +0900
+++ linux-3.2.5/kernel/watchdog.c	2012-02-09 11:39:21.712084495 +0900
@@ -3,12 +3,9 @@
  *
  * started by Don Zickus, Copyright (C) 2010 Red Hat, Inc.
  *
- * this code detects hard lockups: incidents in where on a CPU
- * the kernel does not respond to anything except NMI.
- *
- * Note: Most of this code is borrowed heavily from softlockup.c,
- * so thanks to Ingo for the initial implementation.
- * Some chunks also taken from arch/x86/kernel/apic/nmi.c, thanks
+ * Note: Most of this code is borrowed heavily from the original softlockup
+ * detector, so thanks to Ingo for the initial implementation.
+ * Some chunks also taken from the old x86-specific nmi watchdog code, thanks
  * to those contributors as well.
  */
 
@@ -116,10 +113,11 @@ static unsigned long get_timestamp(int t
 static unsigned long get_sample_period(void)
 {
 	/*
-	 * convert watchdog_thresh from seconds to ns
-	 * the divide by 5 is to give hrtimer 5 chances to
-	 * increment before the hardlockup detector generates
-	 * a warning
+	 * convert watchdog_thresh from seconds to ns the
+	 * divide by 5 is to give hrtimer several chances (two
+	 * or three with the current relation between the soft
+	 * and hard thresholds) to increment before the
+	 * hardlockup detector generates a warning
 	 */
 	return get_softlockup_thresh() * (NSEC_PER_SEC / 5);
 }
@@ -336,9 +334,11 @@ static int watchdog(void *unused)
 
 	set_current_state(TASK_INTERRUPTIBLE);
 	/*
-	 * Run briefly once per second to reset the softlockup timestamp.
-	 * If this gets delayed for more than 60 seconds then the
-	 * debug-printout triggers in watchdog_timer_fn().
+	 * Run briefly (kicked by the hrtimer callback function) once every
+	 * get_sample_period() seconds (4 seconds by default) to reset the
+	 * softlockup timestamp. If this gets delayed for more than
+	 * 2*watchdog_thresh seconds then the debug-printout triggers in
+	 * watchdog_timer_fn().
 	 */
 	while (!kthread_should_stop()) {
 		__touch_watchdog();

  reply	other threads:[~2012-02-09  3:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  9:06 [PATCH] watchdog: update documentation Fernando Luis Vázquez Cao
2012-02-08 18:34 ` Randy Dunlap
2012-02-08 18:43 ` Don Zickus
2012-02-09  1:01   ` Fernando Luis Vázquez Cao
2012-02-09  1:42     ` [PATCH] watchdog: update Kconfig entries Fernando Luis Vázquez Cao
2012-02-09  3:04       ` Fernando Luis Vázquez Cao [this message]
2012-02-09  7:43   ` [PATCH] watchdog: update documentation Ingo Molnar
2012-02-09 14:53     ` Don Zickus
2012-02-09 15:58     ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F3337B4.3010102@oss.ntt.co.jp \
    --to=fernando@oss.ntt.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=dzickus@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.