From: Michal Hocko <mhocko@kernel.org>
To: Ulrich Obergfell <uobergfe@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
dzickus@redhat.com, atomlin@redhat.com, jolsa@kernel.org,
eranian@google.com, cmetcalf@ezchip.com, fweisbec@gmail.com
Subject: Re: [PATCH 1/4] watchdog: introduce watchdog_park_threads() and watchdog_unpark_threads()
Date: Tue, 4 Aug 2015 15:26:27 +0200 [thread overview]
Message-ID: <20150804132626.GE28571@dhcp22.suse.cz> (raw)
In-Reply-To: <1438433365-2979-2-git-send-email-uobergfe@redhat.com>
On Sat 01-08-15 14:49:22, Ulrich Obergfell wrote:
> These functions are intended to be used only from inside kernel/watchdog.c
> to park/unpark all watchdog threads that are specified in watchdog_cpumask.
I would suggest merging this into Patch2. It is usually better to add
new functions along with their users.
> Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
> ---
> kernel/watchdog.c | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index a6ffa43..5571f20 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -24,6 +24,7 @@
> #include <asm/irq_regs.h>
> #include <linux/kvm_para.h>
> #include <linux/perf_event.h>
> +#include <linux/kthread.h>
>
> /*
> * The run state of the lockup detectors is controlled by the content of the
> @@ -666,6 +667,41 @@ static struct smp_hotplug_thread watchdog_threads = {
> .unpark = watchdog_enable,
> };
>
> +/*
> + * park all watchdog threads that are specified in 'watchdog_cpumask'
> + */
> +static int watchdog_park_threads(void)
> +{
> + int cpu, ret = 0;
> +
> + get_online_cpus();
> + for_each_watchdog_cpu(cpu) {
> + ret = kthread_park(per_cpu(softlockup_watchdog, cpu));
> + if (ret)
> + break;
> + }
> + if (ret) {
> + for_each_watchdog_cpu(cpu)
> + kthread_unpark(per_cpu(softlockup_watchdog, cpu));
> + }
> + put_online_cpus();
> +
> + return ret;
> +}
> +
> +/*
> + * unpark all watchdog threads that are specified in 'watchdog_cpumask'
> + */
> +static void watchdog_unpark_threads(void)
> +{
> + int cpu;
> +
> + get_online_cpus();
> + for_each_watchdog_cpu(cpu)
> + kthread_unpark(per_cpu(softlockup_watchdog, cpu));
> + put_online_cpus();
> +}
> +
> static void restart_watchdog_hrtimer(void *info)
> {
> struct hrtimer *hrtimer = raw_cpu_ptr(&watchdog_hrtimer);
> --
> 1.7.11.7
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2015-08-04 13:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-01 12:49 [PATCH 0/4] watchdog: avoid races in watchdog_nmi_{en|disable} functions Ulrich Obergfell
2015-08-01 12:49 ` [PATCH 1/4] watchdog: introduce watchdog_park_threads() and watchdog_unpark_threads() Ulrich Obergfell
2015-08-04 13:26 ` Michal Hocko [this message]
2015-08-04 15:20 ` Ulrich Obergfell
2015-08-01 12:49 ` [PATCH 2/4] watchdog: introduce watchdog_suspend() and watchdog_resume() Ulrich Obergfell
2015-08-01 14:04 ` Guenter Roeck
2015-08-01 14:39 ` Ulrich Obergfell
2015-08-01 14:47 ` Guenter Roeck
2015-08-04 22:58 ` Andrew Morton
2015-08-05 8:10 ` Ulrich Obergfell
2015-08-01 12:49 ` [PATCH 3/4] watchdog: use park/unpark functions in update_watchdog_all_cpus() Ulrich Obergfell
2015-08-01 12:49 ` [PATCH 4/4] watchdog: use suspend/resume interface in fixup_ht_bug() Ulrich Obergfell
2015-08-04 13:31 ` Michal Hocko
2015-08-04 14:27 ` Don Zickus
2015-08-04 14:44 ` Michal Hocko
2015-08-04 14:59 ` Ulrich Obergfell
2015-08-05 22:17 ` Andrew Morton
2015-08-02 10:54 ` [PATCH 0/4] watchdog: avoid races in watchdog_nmi_{en|disable} functions Aaron Tomlin
2015-08-02 22:14 ` Jiri Olsa
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=20150804132626.GE28571@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=atomlin@redhat.com \
--cc=cmetcalf@ezchip.com \
--cc=dzickus@redhat.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=uobergfe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®