{"id":808104,"url":"http://patchwork.ozlabs.org/api/patches/808104/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170831073055.331699267@linutronix.de/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/","list_archive_url":"https://lore.kernel.org/linuxppc-dev/","list_archive_url_format":"https://lore.kernel.org/linuxppc-dev/{}/","commit_url_format":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"},"msgid":"<20170831073055.331699267@linutronix.de>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/20170831073055.331699267@linutronix.de/","date":"2017-08-31T07:16:27","name":"[29/29] lockup_detector: Cleanup hotplug locking mess","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":false,"hash":"6fb9460ebbb52cf8a5f8120f30267a22cb26fd6c","submitter":{"id":180,"url":"http://patchwork.ozlabs.org/api/people/180/?format=json","name":"Thomas Gleixner","email":"tglx@linutronix.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170831073055.331699267@linutronix.de/mbox/","series":[{"id":761,"url":"http://patchwork.ozlabs.org/api/series/761/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=761","date":"2017-08-31T07:16:20","name":null,"version":1,"mbox":"http://patchwork.ozlabs.org/series/761/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/808104/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/808104/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjZ3B1rGgz9sRq\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 17:37:42 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xjZ3B0MzpzDqgB\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 17:37:42 +1000 (AEST)","from Galois.linutronix.de (Galois.linutronix.de\n\t[IPv6:2a01:7a0:2:106d:700::1])\n\t(using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xjYx31rfTzDqSL\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 31 Aug 2017 17:32:23 +1000 (AEST)","from localhost ([127.0.0.1] helo=[127.0.1.1])\n\tby Galois.linutronix.de with esmtp (Exim 4.80)\n\t(envelope-from <tglx@linutronix.de>)\n\tid 1dnJvt-0003LU-OM; Thu, 31 Aug 2017 09:30:34 +0200"],"Message-Id":"<20170831073055.331699267@linutronix.de>","User-Agent":"quilt/0.63-1","Date":"Thu, 31 Aug 2017 09:16:27 +0200","From":"Thomas Gleixner <tglx@linutronix.de>","To":"LKML <linux-kernel@vger.kernel.org>","Subject":"[patch 29/29] lockup_detector: Cleanup hotplug locking mess","References":"<20170831071558.995235362@linutronix.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=ISO-8859-15","Content-Disposition":"inline;\n\tfilename=lockup_detector--Cleanup-hotplug-locking-mess.patch","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"Don Zickus <dzickus@redhat.com>, Chris Metcalf <cmetcalf@mellanox.com>, \n\tPeter Zijlstra <peterz@infradead.org>,\n\tSebastian Siewior <bigeasy@linutronix.de>,\n\tUlrich Obergfell <uobergfe@redhat.com>,\n\tNicholas Piggin <npiggin@gmail.com>, Borislav Petkov <bp@alien8.de>,\n\tAndrew Morton <akpm@linux-foundation.org>, \n\tlinuxppc-dev@lists.ozlabs.org, Ingo Molnar <mingo@kernel.org>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"},"content":"All watchdog thread related functions are delegated to the smpboot thread\ninfrastructure, which handles serialization against CPU hotplug correctly.\n\nThe sysctl interface is completely decoupled from anything which requires\nCPU hotplug protection.\n\nNo need to protect the sysctl writes against cpu hotplug anymore. Remove it\nand add the now required protection to the powerpc arch_nmi_watchdog\nimplementation.\n\nSigned-off-by: Thomas Gleixner <tglx@linutronix.de>\nCc: Benjamin Herrenschmidt <benh@kernel.crashing.org>\nCc: Michael Ellerman <mpe@ellerman.id.au>\nCc: Nicholas Piggin <npiggin@gmail.com>\nCc: linuxppc-dev@lists.ozlabs.org\n---\n arch/powerpc/kernel/watchdog.c |    2 ++\n kernel/watchdog.c              |    6 ------\n 2 files changed, 2 insertions(+), 6 deletions(-)","diff":"--- a/arch/powerpc/kernel/watchdog.c\n+++ b/arch/powerpc/kernel/watchdog.c\n@@ -356,6 +356,7 @@ void watchdog_nmi_reconfigure(bool stop)\n {\n \tint cpu;\n \n+\tcpus_read_lock();\n \tif (stop) {\n \t\tfor_each_cpu(cpu, &wd_cpus_enabled)\n \t\t\tstop_wd_on_cpu(cpu);\n@@ -364,6 +365,7 @@ void watchdog_nmi_reconfigure(bool stop)\n \t\tfor_each_cpu_and(cpu, cpu_online_mask, &watchdog_cpumask)\n \t\t\tstart_wd_on_cpu(cpu);\n \t}\n+\tcpus_read_unlock();\n }\n \n /*\n--- a/kernel/watchdog.c\n+++ b/kernel/watchdog.c\n@@ -652,7 +652,6 @@ static int proc_watchdog_common(int whic\n {\n \tint err, old, *param = table->data;\n \n-\tcpu_hotplug_disable();\n \tmutex_lock(&watchdog_mutex);\n \n \tif (!write) {\n@@ -669,7 +668,6 @@ static int proc_watchdog_common(int whic\n \t\t\tproc_watchdog_update();\n \t}\n \tmutex_unlock(&watchdog_mutex);\n-\tcpu_hotplug_enable();\n \treturn err;\n }\n \n@@ -713,7 +711,6 @@ int proc_watchdog_thresh(struct ctl_tabl\n {\n \tint err, old;\n \n-\tcpu_hotplug_disable();\n \tmutex_lock(&watchdog_mutex);\n \n \told = READ_ONCE(watchdog_thresh);\n@@ -723,7 +720,6 @@ int proc_watchdog_thresh(struct ctl_tabl\n \t\tproc_watchdog_update();\n \n \tmutex_unlock(&watchdog_mutex);\n-\tcpu_hotplug_enable();\n \treturn err;\n }\n \n@@ -738,7 +734,6 @@ int proc_watchdog_cpumask(struct ctl_tab\n {\n \tint err;\n \n-\tcpu_hotplug_disable();\n \tmutex_lock(&watchdog_mutex);\n \n \terr = proc_do_large_bitmap(table, write, buffer, lenp, ppos);\n@@ -746,7 +741,6 @@ int proc_watchdog_cpumask(struct ctl_tab\n \t\tproc_watchdog_update();\n \n \tmutex_unlock(&watchdog_mutex);\n-\tcpu_hotplug_enable();\n \treturn err;\n }\n #endif /* CONFIG_SYSCTL */\n","prefixes":["29/29"]}