From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752351AbdINK4P (ORCPT ); Thu, 14 Sep 2017 06:56:15 -0400 Received: from terminus.zytor.com ([65.50.211.136]:48627 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752123AbdINK4N (ORCPT ); Thu, 14 Sep 2017 06:56:13 -0400 Date: Thu, 14 Sep 2017 03:50:33 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: uobergfe@redhat.com, npiggin@gmail.com, bp@alien8.de, torvalds@linux-foundation.org, dzickus@redhat.com, mingo@kernel.org, akpm@linux-foundation.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, peterz@infradead.org, bigeasy@linutronix.de, cmetcalf@mellanox.com, hpa@zytor.com Reply-To: torvalds@linux-foundation.org, npiggin@gmail.com, uobergfe@redhat.com, bp@alien8.de, dzickus@redhat.com, akpm@linux-foundation.org, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, cmetcalf@mellanox.com, bigeasy@linutronix.de, hpa@zytor.com In-Reply-To: <20170912194148.340708074@linutronix.de> References: <20170912194148.340708074@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] watchdog/hardlockup/perf: Simplify deferred event destroy Git-Commit-ID: a33d44843d4574ec05bec39527d8a87b7af2072c 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 Archived-At: List-Archive: List-Post: Commit-ID: a33d44843d4574ec05bec39527d8a87b7af2072c Gitweb: http://git.kernel.org/tip/a33d44843d4574ec05bec39527d8a87b7af2072c Author: Thomas Gleixner AuthorDate: Tue, 12 Sep 2017 21:37:22 +0200 Committer: Ingo Molnar CommitDate: Thu, 14 Sep 2017 11:41:08 +0200 watchdog/hardlockup/perf: Simplify deferred event destroy Now that all functionality is properly serialized against CPU hotplug, remove the extra per cpu storage which holds the disabled events for cleanup. The core makes sure that cleanup happens before new events are created. 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/20170912194148.340708074@linutronix.de Signed-off-by: Ingo Molnar --- kernel/watchdog_hld.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c index 509bb6b..b293115 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c @@ -21,7 +21,6 @@ static DEFINE_PER_CPU(bool, hard_watchdog_warn); static DEFINE_PER_CPU(bool, watchdog_nmi_touch); static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); -static DEFINE_PER_CPU(struct perf_event *, dead_event); static struct cpumask dead_events_mask; static unsigned long hardlockup_allcpu_dumped; @@ -204,8 +203,6 @@ void hardlockup_detector_perf_disable(void) if (event) { perf_event_disable(event); - this_cpu_write(watchdog_ev, NULL); - this_cpu_write(dead_event, event); cpumask_set_cpu(smp_processor_id(), &dead_events_mask); watchdog_cpus--; } @@ -221,9 +218,9 @@ void hardlockup_detector_perf_cleanup(void) int cpu; for_each_cpu(cpu, &dead_events_mask) { - struct perf_event *event = per_cpu(dead_event, cpu); + struct perf_event *event = per_cpu(watchdog_ev, cpu); - per_cpu(dead_event, cpu) = NULL; + per_cpu(watchdog_ev, cpu) = NULL; perf_event_release_kernel(event); } cpumask_clear(&dead_events_mask);