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


Groups > linux.kernel > #1234438 > unrolled thread

[PATCH 5/5] watchdog: do not unpark threads in watchdog_park_threads() on error

Started byUlrich Obergfell <uobergfe@redhat.com>
First post2015-09-28 22:50 +0200
Last post2015-09-29 08:50 +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

  [PATCH 5/5] watchdog: do not unpark threads in watchdog_park_threads() on error Ulrich Obergfell <uobergfe@redhat.com> - 2015-09-28 22:50 +0200
    Re: [PATCH 5/5] watchdog: do not unpark threads in  watchdog_park_threads() on error Aaron Tomlin <atomlin@redhat.com> - 2015-09-29 08:50 +0200

#1234438 — [PATCH 5/5] watchdog: do not unpark threads in watchdog_park_threads() on error

FromUlrich Obergfell <uobergfe@redhat.com>
Date2015-09-28 22:50 +0200
Subject[PATCH 5/5] watchdog: do not unpark threads in watchdog_park_threads() on error
Message-ID<qdNx1-23T-33@gated-at.bofh.it>
If kthread_park() returns an error, watchdog_park_threads() should not
blindly 'roll back' the already parked threads to the unparked state.
Instead leave it up to the callers to handle such errors appropriately
in their context. For example, it is redundant to unpark the threads
if the lockup detectors will soon be disabled by the callers anyway.

Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
---
 kernel/watchdog.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 3bc22a9..af70bf2 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -654,6 +654,12 @@ static struct smp_hotplug_thread watchdog_threads = {
 
 /*
  * park all watchdog threads that are specified in 'watchdog_cpumask'
+ *
+ * This function returns an error if kthread_park() of a watchdog thread
+ * fails. In this situation, the watchdog threads of some CPUs can already
+ * be parked and the watchdog threads of other CPUs can still be runnable.
+ * Callers are expected to handle this special condition as appropriate in
+ * their context.
  */
 static int watchdog_park_threads(void)
 {
@@ -665,10 +671,6 @@ static int watchdog_park_threads(void)
 		if (ret)
 			break;
 	}
-	if (ret) {
-		for_each_watchdog_cpu(cpu)
-			kthread_unpark(per_cpu(softlockup_watchdog, cpu));
-	}
 	put_online_cpus();
 
 	return ret;
-- 
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/

[toc] | [next] | [standalone]


#1234751 — Re: [PATCH 5/5] watchdog: do not unpark threads in watchdog_park_threads() on error

FromAaron Tomlin <atomlin@redhat.com>
Date2015-09-29 08:50 +0200
SubjectRe: [PATCH 5/5] watchdog: do not unpark threads in watchdog_park_threads() on error
Message-ID<qdWTE-792-19@gated-at.bofh.it>
In reply to#1234438

[Multipart message — attachments visible in raw view] — view raw

On Mon 2015-09-28 22:44 +0200, Ulrich Obergfell wrote:
> If kthread_park() returns an error, watchdog_park_threads() should not
> blindly 'roll back' the already parked threads to the unparked state.
> Instead leave it up to the callers to handle such errors appropriately
> in their context. For example, it is redundant to unpark the threads
> if the lockup detectors will soon be disabled by the callers anyway.
> 
> Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
> ---
>  kernel/watchdog.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index 3bc22a9..af70bf2 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -654,6 +654,12 @@ static struct smp_hotplug_thread watchdog_threads = {
>  
>  /*
>   * park all watchdog threads that are specified in 'watchdog_cpumask'
> + *
> + * This function returns an error if kthread_park() of a watchdog thread
> + * fails. In this situation, the watchdog threads of some CPUs can already
> + * be parked and the watchdog threads of other CPUs can still be runnable.
> + * Callers are expected to handle this special condition as appropriate in
> + * their context.
>   */
>  static int watchdog_park_threads(void)
>  {
> @@ -665,10 +671,6 @@ static int watchdog_park_threads(void)
>  		if (ret)
>  			break;
>  	}
> -	if (ret) {
> -		for_each_watchdog_cpu(cpu)
> -			kthread_unpark(per_cpu(softlockup_watchdog, cpu));
> -	}
>  	put_online_cpus();
>  
>  	return ret;

Reviewed-by: Aaron Tomlin <atomlin@redhat.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web