From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752146AbdINKwU (ORCPT ); Thu, 14 Sep 2017 06:52:20 -0400 Received: from terminus.zytor.com ([65.50.211.136]:51133 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbdINKwT (ORCPT ); Thu, 14 Sep 2017 06:52:19 -0400 Date: Thu, 14 Sep 2017 03:46:39 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org, hpa@zytor.com, peterz@infradead.org, npiggin@gmail.com, cmetcalf@mellanox.com, bp@alien8.de, linux-kernel@vger.kernel.org, mingo@kernel.org, dzickus@redhat.com, tglx@linutronix.de, bigeasy@linutronix.de, uobergfe@redhat.com Reply-To: bigeasy@linutronix.de, tglx@linutronix.de, uobergfe@redhat.com, npiggin@gmail.com, peterz@infradead.org, hpa@zytor.com, torvalds@linux-foundation.org, akpm@linux-foundation.org, dzickus@redhat.com, mingo@kernel.org, linux-kernel@vger.kernel.org, bp@alien8.de, cmetcalf@mellanox.com In-Reply-To: <20170912194147.549114957@linutronix.de> References: <20170912194147.549114957@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] watchdog/core: Further simplify sysctl handling Git-Commit-ID: e8b62b2dd14f8f2427856ba24cb7db922bda9bfd X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: e8b62b2dd14f8f2427856ba24cb7db922bda9bfd Gitweb: http://git.kernel.org/tip/e8b62b2dd14f8f2427856ba24cb7db922bda9bfd Author: Thomas Gleixner AuthorDate: Tue, 12 Sep 2017 21:37:12 +0200 Committer: Ingo Molnar CommitDate: Thu, 14 Sep 2017 11:41:06 +0200 watchdog/core: Further simplify sysctl handling Use a single function to update sysctl changes. This is not a high frequency user space interface and it's root only. Preparatory patch to cleanup the sysctl variable handling. Signed-off-by: Thomas Gleixner Reviewed-by: Don Zickus Cc: Andrew Morton Cc: Borislav Petkov Cc: Chris Metcalf Cc: Linus Torvalds Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Sebastian Siewior Cc: Ulrich Obergfell Link: http://lkml.kernel.org/r/20170912194147.549114957@linutronix.de Signed-off-by: Ingo Molnar --- kernel/watchdog.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 762d3ed..ca87472 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -507,11 +507,8 @@ static void softlockup_park_all_threads(void) softlockup_update_smpboot_threads(); } -/* - * Park threads which are not longer enabled and unpark threads which have - * been newly enabled. - */ -static void softlockup_update_threads(void) +/* Unpark enabled threads */ +static void softlockup_unpark_threads(void) { cpumask_copy(&watchdog_allowed_mask, &watchdog_cpumask); softlockup_update_smpboot_threads(); @@ -522,7 +519,7 @@ static void softlockup_reconfigure_threads(bool enabled) softlockup_park_all_threads(); set_sample_period(); if (enabled) - softlockup_update_threads(); + softlockup_unpark_threads(); } /* @@ -563,7 +560,6 @@ static inline void watchdog_unpark_threads(void) { } static inline int watchdog_enable_all_cpus(void) { return 0; } static inline void watchdog_disable_all_cpus(void) { } static inline void softlockup_init_threads(void) { } -static inline void softlockup_update_threads(void) { } static inline void softlockup_reconfigure_threads(bool enabled) { } #endif /* !CONFIG_SOFTLOCKUP_DETECTOR */ @@ -598,11 +594,11 @@ void lockup_detector_soft_poweroff(void) #ifdef CONFIG_SYSCTL -/* - * Update the run state of the lockup detectors. - */ +/* Propagate any changes to the watchdog threads */ static void proc_watchdog_update(void) { + /* Remove impossible cpus to keep sysctl output clean. */ + cpumask_and(&watchdog_cpumask, &watchdog_cpumask, cpu_possible_mask); softlockup_reconfigure_threads(watchdog_enabled && watchdog_thresh); watchdog_nmi_reconfigure(); } @@ -721,15 +717,6 @@ int proc_watchdog_thresh(struct ctl_table *table, int write, return err; } -static void proc_watchdog_cpumask_update(void) -{ - /* Remove impossible cpus to keep sysctl output clean. */ - cpumask_and(&watchdog_cpumask, &watchdog_cpumask, cpu_possible_mask); - - softlockup_update_threads(); - watchdog_nmi_reconfigure(); -} - /* * The cpumask is the mask of possible cpus that the watchdog can run * on, not the mask of cpus it is actually running on. This allows the @@ -746,7 +733,7 @@ int proc_watchdog_cpumask(struct ctl_table *table, int write, err = proc_do_large_bitmap(table, write, buffer, lenp, ppos); if (!err && write) - proc_watchdog_cpumask_update(); + proc_watchdog_update(); mutex_unlock(&watchdog_mutex); cpu_hotplug_enable();