From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934198AbbHDN0b (ORCPT ); Tue, 4 Aug 2015 09:26:31 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:36905 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933244AbbHDN0a (ORCPT ); Tue, 4 Aug 2015 09:26:30 -0400 Date: Tue, 4 Aug 2015 15:26:27 +0200 From: Michal Hocko To: Ulrich Obergfell 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() Message-ID: <20150804132626.GE28571@dhcp22.suse.cz> References: <1438433365-2979-1-git-send-email-uobergfe@redhat.com> <1438433365-2979-2-git-send-email-uobergfe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438433365-2979-2-git-send-email-uobergfe@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.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. > Signed-off-by: Ulrich Obergfell > --- > 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 > #include > #include > +#include > > /* > * 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