Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1199831 > unrolled thread

Re: [PATCH 1/4] watchdog: introduce watchdog_park_threads() and watchdog_unpark_threads()

Started byMichal Hocko <mhocko@kernel.org>
First post2015-08-04 15:30 +0200
Last post2015-08-04 17:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/4] watchdog: introduce watchdog_park_threads() and  watchdog_unpark_threads() Michal Hocko <mhocko@kernel.org> - 2015-08-04 15:30 +0200
    Re: [PATCH 1/4] watchdog: introduce watchdog_park_threads() and  watchdog_unpark_threads() Ulrich Obergfell <uobergfe@redhat.com> - 2015-08-04 17:30 +0200

#1199831 — Re: [PATCH 1/4] watchdog: introduce watchdog_park_threads() and watchdog_unpark_threads()

FromMichal Hocko <mhocko@kernel.org>
Date2015-08-04 15:30 +0200
SubjectRe: [PATCH 1/4] watchdog: introduce watchdog_park_threads() and watchdog_unpark_threads()
Message-ID<pTKs2-3mh-25@gated-at.bofh.it>
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
--
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/

[toc] | [next] | [standalone]


#1200080

FromUlrich Obergfell <uobergfe@redhat.com>
Date2015-08-04 17:30 +0200
Message-ID<pTMkc-65J-55@gated-at.bofh.it>
In reply to#1199831
> ----- Original Message -----
> From: "Michal Hocko" <mhocko@kernel.org>
...
> 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.

Michal,

watchdog_{park|unpark}_threads are called by watchdog_{suspend|resume}
in Patch 2/4 and by update_watchdog_all_cpus() in Patch 3/4, so I would
have to merge three patches into one, and I would end up with one large
patch and one smaller patch. I think the result would be harder to read,
review and understand. Thus I'd prefer to leave the patches split as they
currently are.

Regards,

Uli
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web