All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] watchdog: fix rounding issues in get_sample_period()
@ 2011-05-16 23:34 Mandeep Singh Baines
  2011-05-16 23:34 ` [PATCH 2/4] watchdog: only disable/enable watchdog if neccessary Mandeep Singh Baines
                   ` (3 more replies)
  0 siblings, 4 replies; 30+ messages in thread
From: Mandeep Singh Baines @ 2011-05-16 23:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mandeep Singh Baines, Marcin Slusarz, Don Zickus, Peter Zijlstra,
	Frederic Weisbecker, Ingo Molnar

In get_sample_period(), softlockup_thresh is integer divided by 5 before
the multiplication by NSEC_PER_SEC. This results in softlockup_thresh
being rounded down to the nearest integer multiple of 5.

For example, a softlockup_thresh of 4 rounds down to 0.

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
---
 kernel/watchdog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 14733d4..a06972d 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -110,7 +110,7 @@ static unsigned long get_sample_period(void)
 	 * increment before the hardlockup detector generates
 	 * a warning
 	 */
-	return softlockup_thresh / 5 * NSEC_PER_SEC;
+	return softlockup_thresh * (NSEC_PER_SEC / 5);
 }
 
 /* Commands for resetting the watchdog */
-- 
1.7.3.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread
* [PATCH 1/4] watchdog: fix rounding issues in get_sample_period()
@ 2011-05-23  5:10 Mandeep Singh Baines
  2011-05-23  5:10 ` [PATCH 2/4] watchdog: only disable/enable watchdog if neccessary Mandeep Singh Baines
                   ` (3 more replies)
  0 siblings, 4 replies; 30+ messages in thread
From: Mandeep Singh Baines @ 2011-05-23  5:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mandeep Singh Baines, Marcin Slusarz, Don Zickus, Peter Zijlstra,
	Frederic Weisbecker, Ingo Molnar, Andrew Morton

In get_sample_period(), softlockup_thresh is integer divided by 5 before
the multiplication by NSEC_PER_SEC. This results in softlockup_thresh
being rounded down to the nearest integer multiple of 5.

For example, a softlockup_thresh of 4 rounds down to 0.

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 kernel/watchdog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 14733d4..a06972d 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -110,7 +110,7 @@ static unsigned long get_sample_period(void)
 	 * increment before the hardlockup detector generates
 	 * a warning
 	 */
-	return softlockup_thresh / 5 * NSEC_PER_SEC;
+	return softlockup_thresh * (NSEC_PER_SEC / 5);
 }
 
 /* Commands for resetting the watchdog */
-- 
1.7.3.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread
* linux-next: build warning in Lunus' tree
@ 2011-05-24  3:41 Stephen Rothwell
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Rothwell @ 2011-05-24  3:41 UTC (permalink / raw)
  To: Linus; +Cc: linux-next, linux-kernel, Mandeep Singh Baines, Ingo Molnar

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

Hi all,

In Linus' tree, today's linux-next build (sparc64 defconfig)
produced this warning:

kernel/watchdog.c:102: warning: function declaration isn't a prototype

Introduced by commit 4eec42f39204 ("watchdog: Change the default timeout
and configure nmi watchdog period based").

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2011-06-09 14:52 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16 23:34 [PATCH 1/4] watchdog: fix rounding issues in get_sample_period() Mandeep Singh Baines
2011-05-16 23:34 ` [PATCH 2/4] watchdog: only disable/enable watchdog if neccessary Mandeep Singh Baines
2011-05-16 23:35 ` [PATCH 3/4] watchdog: disable watchdog when thresh is zero Mandeep Singh Baines
2011-05-17  7:10   ` Ingo Molnar
2011-05-18  3:36     ` [PATCH 3/4 v2] " Mandeep Singh Baines
2011-05-18  8:35       ` Ingo Molnar
2011-05-19 16:20         ` [PATCH 3/4 v3] " Mandeep Singh Baines
2011-05-23 11:13     ` [tip:perf/urgent] watchdog: Disable " tip-bot for Mandeep Singh Baines
2011-05-16 23:35 ` [PATCH 4/4] watchdog: configure nmi watchdog period based on watchdog_thresh Mandeep Singh Baines
2011-05-17  7:16   ` Ingo Molnar
2011-05-17 14:03     ` Don Zickus
2011-05-17 18:47       ` Ingo Molnar
2011-05-18  3:44     ` [PATCH 4/4 v2] " Mandeep Singh Baines
2011-05-18  8:39       ` Ingo Molnar
2011-05-18 13:51         ` Don Zickus
2011-05-23 11:13     ` [tip:perf/urgent] watchdog: Change the default timeout and " tip-bot for Mandeep Singh Baines
2011-05-24  3:58     ` [tip:perf/urgent] watchdog: Fix non-standard prototype of get_softlockup_thresh() tip-bot for Ingo Molnar
2011-05-18 13:53 ` [PATCH 1/4] watchdog: fix rounding issues in get_sample_period() Don Zickus
2011-05-19 16:26   ` Mandeep Singh Baines
2011-05-20 11:51     ` Ingo Molnar
2011-05-23  5:14       ` Mandeep Singh Baines
2011-06-09 11:47     ` Don Zickus
2011-06-09 14:51       ` Mandeep Singh Baines
2011-05-23  5:10 Mandeep Singh Baines
2011-05-23  5:10 ` [PATCH 2/4] watchdog: only disable/enable watchdog if neccessary Mandeep Singh Baines
2011-05-23 11:12   ` [tip:perf/urgent] watchdog: Only " tip-bot for Mandeep Singh Baines
2011-05-23  5:10 ` [PATCH 3/4] watchdog: disable watchdog when thresh is zero Mandeep Singh Baines
2011-05-23  5:10 ` [PATCH 4/4] watchdog: configure nmi watchdog period based on watchdog_thresh Mandeep Singh Baines
2011-05-23 11:12 ` [tip:perf/urgent] watchdog: Fix rounding bug in get_sample_period() tip-bot for Mandeep Singh Baines
2011-05-24  3:41 linux-next: build warning in Lunus' tree Stephen Rothwell

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.