mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Li Huafei" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Li Huafei <lihuafei1@huawei.com>, Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: perf/core] watchdog/hardlockup/perf: Warn if watchdog_ev is leaked
Date: Thu, 06 Mar 2025 11:19:53 -0000	[thread overview]
Message-ID: <174125999340.14745.5633520821144529020.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20241021193004.308303-2-lihuafei1@huawei.com>

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     05763885e327f0e257ee8b96b30ac1b95f7dd532
Gitweb:        https://git.kernel.org/tip/05763885e327f0e257ee8b96b30ac1b95f7dd532
Author:        Li Huafei <lihuafei1@huawei.com>
AuthorDate:    Tue, 22 Oct 2024 03:30:04 +08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Thu, 06 Mar 2025 12:07:39 +01:00

watchdog/hardlockup/perf: Warn if watchdog_ev is leaked

When creating a new perf_event for the hardlockup watchdog, it should not
happen that the old perf_event is not released.

Introduce a WARN_ONCE() that should never trigger.

[ mingo: Changed the type of the warning to WARN_ONCE(). ]

Signed-off-by: Li Huafei <lihuafei1@huawei.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20241021193004.308303-2-lihuafei1@huawei.com
---
 kernel/watchdog_perf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/watchdog_perf.c b/kernel/watchdog_perf.c
index 2fdb96e..a78ff09 100644
--- a/kernel/watchdog_perf.c
+++ b/kernel/watchdog_perf.c
@@ -144,6 +144,7 @@ static int hardlockup_detector_event_create(void)
 			 PTR_ERR(evt));
 		return PTR_ERR(evt);
 	}
+	WARN_ONCE(this_cpu_read(watchdog_ev), "unexpected watchdog_ev leak");
 	this_cpu_write(watchdog_ev, evt);
 	return 0;
 }

  reply	other threads:[~2025-03-06 11:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21 19:30 [PATCH RESEND 1/2] watchdog/hardlockup/perf: Fix perf_event memory leak Li Huafei
2024-10-21 19:30 ` [PATCH RESEND 2/2] watchdog/hardlockup/perf: Warn if watchdog_ev is overwritten Li Huafei
2025-03-06 11:19   ` tip-bot2 for Li Huafei [this message]
2024-11-06 10:35 ` [PATCH RESEND 1/2] watchdog/hardlockup/perf: Fix perf_event memory leak Li Huafei
2025-03-06 11:19 ` [tip: perf/core] " tip-bot2 for Li Huafei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=174125999340.14745.5633520821144529020.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=lihuafei1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®