public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Marcin Slusarz <marcin.slusarz@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	a.p.zijlstra@chello.nl, marcin.slusarz@gmail.com,
	fweisbec@gmail.com, stable@kernel.org, tglx@linutronix.de,
	mingo@elte.hu, dzickus@redhat.com
Subject: [tip:perf/urgent] watchdog: Fix sysctl consistency
Date: Mon, 31 Jan 2011 12:51:53 GMT	[thread overview]
Message-ID: <tip-397357666de6b5b6adb5fa99f9758ec8cf30ac34@git.kernel.org> (raw)
In-Reply-To: <1296230433-6261-2-git-send-email-dzickus@redhat.com>

Commit-ID:  397357666de6b5b6adb5fa99f9758ec8cf30ac34
Gitweb:     http://git.kernel.org/tip/397357666de6b5b6adb5fa99f9758ec8cf30ac34
Author:     Marcin Slusarz <marcin.slusarz@gmail.com>
AuthorDate: Fri, 28 Jan 2011 11:00:32 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 31 Jan 2011 13:22:43 +0100

watchdog: Fix sysctl consistency

If it was not possible to enable watchdog for any cpu, switch
watchdog_enabled back to 0, because it's visible via
kernel.watchdog sysctl.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: <stable@kernel.org>
LKML-Reference: <1296230433-6261-2-git-send-email-dzickus@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/watchdog.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index d9961ea..c7e0049 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -429,9 +429,6 @@ static int watchdog_enable(int cpu)
 		wake_up_process(p);
 	}
 
-	/* if any cpu succeeds, watchdog is considered enabled for the system */
-	watchdog_enabled = 1;
-
 	return 0;
 }
 
@@ -459,12 +456,16 @@ static void watchdog_disable(int cpu)
 static void watchdog_enable_all_cpus(void)
 {
 	int cpu;
-	int result = 0;
+
+	watchdog_enabled = 0;
 
 	for_each_online_cpu(cpu)
-		result += watchdog_enable(cpu);
+		if (!watchdog_enable(cpu))
+			/* if any cpu succeeds, watchdog is considered
+			   enabled for the system */
+			watchdog_enabled = 1;
 
-	if (result)
+	if (!watchdog_enabled)
 		printk(KERN_ERR "watchdog: failed to be enabled on some cpus\n");
 
 }

  reply	other threads:[~2011-01-31 12:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28 16:00 [PATCH 1/3] watchdog: Fix broken nowatchdog logic Don Zickus
2011-01-28 16:00 ` [PATCH 2/3] watchdog: Fix sysctl consistency Don Zickus
2011-01-31 12:51   ` tip-bot for Marcin Slusarz [this message]
2011-01-28 16:00 ` [PATCH 3/3] watchdog: Don't change watchdog state on read of sysctl Don Zickus
2011-01-31 12:52   ` [tip:perf/urgent] " tip-bot for Marcin Slusarz
2011-01-31 12:51 ` [tip:perf/urgent] watchdog: Fix broken nowatchdog logic tip-bot for Marcin Slusarz

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=tip-397357666de6b5b6adb5fa99f9758ec8cf30ac34@git.kernel.org \
    --to=marcin.slusarz@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=dzickus@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=stable@kernel.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox