From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752111AbdINKrm (ORCPT ); Thu, 14 Sep 2017 06:47:42 -0400 Received: from terminus.zytor.com ([65.50.211.136]:33785 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751833AbdINKrj (ORCPT ); Thu, 14 Sep 2017 06:47:39 -0400 Date: Thu, 14 Sep 2017 03:41:57 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: tglx@linutronix.de, peterz@infradead.org, hpa@zytor.com, dzickus@redhat.com, npiggin@gmail.com, bp@alien8.de, cmetcalf@mellanox.com, mingo@kernel.org, torvalds@linux-foundation.org, uobergfe@redhat.com, linux-kernel@vger.kernel.org, bigeasy@linutronix.de, akpm@linux-foundation.org Reply-To: tglx@linutronix.de, peterz@infradead.org, hpa@zytor.com, npiggin@gmail.com, dzickus@redhat.com, bp@alien8.de, akpm@linux-foundation.org, bigeasy@linutronix.de, torvalds@linux-foundation.org, cmetcalf@mellanox.com, mingo@kernel.org, linux-kernel@vger.kernel.org, uobergfe@redhat.com In-Reply-To: <20170912194146.568079057@linutronix.de> References: <20170912194146.568079057@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] watchdog/core: Rework CPU hotplug locking Git-Commit-ID: b7a349819d4b9b5db64e523351e66a79a758eaa5 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: b7a349819d4b9b5db64e523351e66a79a758eaa5 Gitweb: http://git.kernel.org/tip/b7a349819d4b9b5db64e523351e66a79a758eaa5 Author: Thomas Gleixner AuthorDate: Tue, 12 Sep 2017 21:37:00 +0200 Committer: Ingo Molnar CommitDate: Thu, 14 Sep 2017 11:41:04 +0200 watchdog/core: Rework CPU hotplug locking The watchdog proc interface causes extensive recursive locking of the CPU hotplug percpu rwsem, which is deadlock prone. Replace the get/put_online_cpus() pairs with cpu_hotplug_disable()/enable() calls for now. Later patches will remove that requirement completely. Reported-by: Borislav Petkov Signed-off-by: Thomas Gleixner Reviewed-by: Don Zickus Cc: Andrew Morton Cc: Chris Metcalf Cc: Linus Torvalds Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Sebastian Siewior Cc: Ulrich Obergfell Link: http://lkml.kernel.org/r/20170912194146.568079057@linutronix.de Signed-off-by: Ingo Molnar --- kernel/watchdog.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index b2d4675..cd79f64 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -703,7 +703,7 @@ static int proc_watchdog_common(int which, struct ctl_table *table, int write, int err, old, new; int *watchdog_param = (int *)table->data; - get_online_cpus(); + cpu_hotplug_disable(); mutex_lock(&watchdog_proc_mutex); /* @@ -752,7 +752,7 @@ static int proc_watchdog_common(int which, struct ctl_table *table, int write, } out: mutex_unlock(&watchdog_proc_mutex); - put_online_cpus(); + cpu_hotplug_enable(); return err; } @@ -794,7 +794,7 @@ int proc_watchdog_thresh(struct ctl_table *table, int write, { int err, old, new; - get_online_cpus(); + cpu_hotplug_disable(); mutex_lock(&watchdog_proc_mutex); old = ACCESS_ONCE(watchdog_thresh); @@ -818,7 +818,7 @@ int proc_watchdog_thresh(struct ctl_table *table, int write, } out: mutex_unlock(&watchdog_proc_mutex); - put_online_cpus(); + cpu_hotplug_enable(); return err; } @@ -833,7 +833,7 @@ int proc_watchdog_cpumask(struct ctl_table *table, int write, { int err; - get_online_cpus(); + cpu_hotplug_disable(); mutex_lock(&watchdog_proc_mutex); err = proc_do_large_bitmap(table, write, buffer, lenp, ppos); @@ -856,7 +856,7 @@ int proc_watchdog_cpumask(struct ctl_table *table, int write, } mutex_unlock(&watchdog_proc_mutex); - put_online_cpus(); + cpu_hotplug_enable(); return err; }