[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110517071018.GE22305@elte.hu>
Date: Tue, 17 May 2011 09:10:18 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Mandeep Singh Baines <msb@...omium.org>
Cc: linux-kernel@...r.kernel.org,
Marcin Slusarz <marcin.slusarz@...il.com>,
Don Zickus <dzickus@...hat.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 3/4] watchdog: disable watchdog when thresh is zero
* Mandeep Singh Baines <msb@...omium.org> wrote:
> This restores the previous behavior of softlock_thresh.
>
> Currently, setting watchdog_thresh to zero causes the watchdog
> kthreads to consume a lot of CPU.
>
> Signed-off-by: Mandeep Singh Baines <msb@...omium.org>
> Cc: Marcin Slusarz <marcin.slusarz@...il.com>
> Cc: Don Zickus <dzickus@...hat.com>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Ingo Molnar <mingo@...e.hu>
> ---
> kernel/watchdog.c | 15 ++++++++++++++-
> 1 files changed, 14 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index cf0e09f..50c2f62 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -526,7 +526,20 @@ int proc_dowatchdog_thresh(struct ctl_table *table, int write,
> void __user *buffer,
> size_t *lenp, loff_t *ppos)
> {
> - return proc_dointvec_minmax(table, write, buffer, lenp, ppos);
> + int ret;
> +
> + ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
> + if (ret || !write)
> + goto out;
> +
> + if (softlockup_thresh)
> + watchdog_enable_all_cpus();
> + else
> + watchdog_disable_all_cpus();
This now adds two similar looking blocks of these 4 lines, one in
proc_dowatchdog_enabled(), one in proc_dowatchdog_thresh().
They are not the same though. So what happens if the watchdog is disabled but
the threshold is updated to nonzero - do we enable the watchdog?
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists