From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 832F6C8300C for ; Sat, 10 Jun 2023 00:45:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232209AbjFJApt (ORCPT ); Fri, 9 Jun 2023 20:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232532AbjFJApi (ORCPT ); Fri, 9 Jun 2023 20:45:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CF573AB3 for ; Fri, 9 Jun 2023 17:45:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CAE95651B5 for ; Sat, 10 Jun 2023 00:45:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DABEC433D2; Sat, 10 Jun 2023 00:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1686357936; bh=1eJMNMf//QjzVgov1A3wuZnCCBVN1soNXtC65NmILc4=; h=Date:To:From:Subject:From; b=aEhpiE8gzN6jEvnXZKzDnmoHjMEeBl90Z9m0PaqBL+ARJ493NsKvjSKDGF6rkoUcc dE+yLtJoTl7ZbVou1HhCohZH3CnJamlakS2YxuOMBSyaJSqdzVVL7fnrJDu9DhIENW 1hs5hJC/DgIc0XJiyVf/eQjUii2RwWlynAuHEOFE= Date: Fri, 09 Jun 2023 17:45:35 -0700 To: mm-commits@vger.kernel.org, will@kernel.org, wens@csie.org, tzungbi@chromium.org, swboyd@chromium.org, sumit.garg@linaro.org, ricardo.neri@intel.com, rdunlap@infradead.org, ravi.v.shankar@intel.com, pmladek@suse.com, npiggin@gmail.com, msys.mizuma@gmail.com, mpe@ellerman.id.au, mka@chromium.org, maz@kernel.org, mark.rutland@arm.com, lecopzer.chen@mediatek.com, irogers@google.com, groeck@chromium.org, eranian@google.com, dianders@chromium.org, davem@davemloft.net, daniel.thompson@linaro.org, christophe.leroy@csgroup.eu, ccross@android.com, catalin.marinas@arm.com, ak@linux.intel.com, kernelfans@gmail.com, akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-nonmm-stable] watchdog-perf-ensure-cpu-bound-context-when-creating-hardlockup-detector-event.patch removed from -mm tree Message-Id: <20230610004536.2DABEC433D2@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The quilt patch titled Subject: watchdog/perf: ensure CPU-bound context when creating hardlockup detector event has been removed from the -mm tree. Its filename was watchdog-perf-ensure-cpu-bound-context-when-creating-hardlockup-detector-event.patch This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Pingfan Liu Subject: watchdog/perf: ensure CPU-bound context when creating hardlockup detector event Date: Fri, 19 May 2023 10:18:29 -0700 hardlockup_detector_event_create() should create perf_event on the current CPU. Preemption could not get disabled because perf_event_create_kernel_counter() allocates memory. Instead, the CPU locality is achieved by processing the code in a per-CPU bound kthread. Add a check to prevent mistakes when calling the code in another code path. Link: https://lkml.kernel.org/r/20230519101840.v5.5.I654063e53782b11d53e736a8ad4897ffd207406a@changeid Signed-off-by: Pingfan Liu Co-developed-by: Lecopzer Chen Signed-off-by: Lecopzer Chen Signed-off-by: Douglas Anderson Reviewed-by: Petr Mladek Cc: Andi Kleen Cc: Catalin Marinas Cc: Chen-Yu Tsai Cc: Christophe Leroy Cc: Colin Cross Cc: Daniel Thompson Cc: "David S. Miller" Cc: Guenter Roeck Cc: Ian Rogers Cc: Marc Zyngier Cc: Mark Rutland Cc: Masayoshi Mizuma Cc: Matthias Kaehlcke Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: Ricardo Neri Cc: Stephane Eranian Cc: Stephen Boyd Cc: Sumit Garg Cc: Tzung-Bi Shih Cc: Will Deacon Signed-off-by: Andrew Morton --- kernel/watchdog_hld.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/kernel/watchdog_hld.c~watchdog-perf-ensure-cpu-bound-context-when-creating-hardlockup-detector-event +++ a/kernel/watchdog_hld.c @@ -165,10 +165,16 @@ static void watchdog_overflow_callback(s static int hardlockup_detector_event_create(void) { - unsigned int cpu = smp_processor_id(); + unsigned int cpu; struct perf_event_attr *wd_attr; struct perf_event *evt; + /* + * Preemption is not disabled because memory will be allocated. + * Ensure CPU-locality by calling this in per-CPU kthread. + */ + WARN_ON(!is_percpu_thread()); + cpu = raw_smp_processor_id(); wd_attr = &wd_hw_attr; wd_attr->sample_period = hw_nmi_get_sample_period(watchdog_thresh); _ Patches currently in -mm which might be from kernelfans@gmail.com are