All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: <sashiko-reviews@lists.linux.dev>
Cc: <linux-perf-users@vger.kernel.org>
Subject: Re: [PATCH 6/6] perf/x86/intel/pt: Stop tracing across system suspend
Date: Tue, 3 Nov 2026 17:57:11 +0200	[thread overview]
Message-ID: <1cb49f46-9453-4ea2-adb1-e78575837d09@intel.com> (raw)
In-Reply-To: <sashiko-outbox-193146@kernel.org>

On 02/11/2026 10:59, sashiko-bot@kernel.org wrote:
> Can pt_syscore_resume() prematurely restart an Intel PT event that has been
> throttled by perf_event_throttle(), leading to a duplicate pt_event_start()
> call when the event is unthrottled on the next timer tick?


Yes, the duplicate start can happen

> Also, if pt_syscore_resume() skips calling pt_event_start() when the event is
> throttled, wouldn't clearing pt_suspended_event in pt_syscore_resume() before
> perf_event_unthrottle() later calls pt_event_start() cause a throttled
> snapshot event to read reset PT MSRs in pt_read_offset() and take the
> pt_config_enable() path without reprogramming the output MSRs?

Right, so keep the restart and make the redundant start a no-op
instead.  An event with both PERF_HES_UPTODATE and PERF_HES_STOPPED
clear is already running.

 	if (!(hwc->state & PERF_HES_UPTODATE)) {
+		/* Already running, e.g. restarted by pt_syscore_resume() */
+		if (!(hwc->state & PERF_HES_STOPPED))
+			return;
	hwc->state &= ~PERF_HES_STOPPED;

One side effect remains. A throttled PT event restarted on resume
traces until the next tick while its sibling is still throttled.
That lasts at most one tick and is harmless.


  reply	other threads:[~2026-11-03 15:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02  7:40 [PATCH 0/6] perf/x86/intel/pt: Fix tracing across kexec, kdump and suspend Adrian Hunter
2026-11-02  7:40 ` [PATCH 1/6] irq_work: Re-raise pending irq_work after system resume Adrian Hunter
2026-11-02  7:51   ` sashiko-bot
2026-11-02  9:06   ` Peter Zijlstra
2026-11-02 10:54     ` Adrian Hunter
2026-11-02 16:39       ` Sebastian Andrzej Siewior
2026-11-03 15:46         ` Adrian Hunter
2026-11-02  7:40 ` [PATCH 2/6] perf/x86/intel/pt: Stop tracing if VMXON has not yet happened Adrian Hunter
2026-11-02  7:59   ` sashiko-bot
2026-11-02  9:57   ` Peter Zijlstra
2026-11-02 11:04     ` Adrian Hunter
2026-11-02 11:07       ` Peter Zijlstra
2026-11-02  7:40 ` [PATCH 3/6] perf/x86/intel/pt: Stop tracing at syscore shutdown Adrian Hunter
2026-11-02  8:05   ` sashiko-bot
2026-11-02 10:04   ` Peter Zijlstra
2026-11-02 10:23     ` Adrian Hunter
2026-11-02 11:01       ` Peter Zijlstra
2026-11-02 16:15   ` Andi Kleen
2026-11-02 16:27     ` Adrian Hunter
2026-11-02 17:45       ` Andi Kleen
2026-11-02 18:13         ` Adrian Hunter
2026-11-02  7:40 ` [PATCH 4/6] perf/x86/intel/pt: Clear TraceEn in hardware in cpu_emergency_stop_pt() Adrian Hunter
2026-11-02  8:21   ` sashiko-bot
2026-11-02 10:07   ` Peter Zijlstra
2026-11-02 18:41     ` Adrian Hunter
2026-11-02  7:40 ` [PATCH 5/6] perf/x86/intel/pt: Reset stale MSR state on CPU start and resume Adrian Hunter
2026-11-02  8:31   ` sashiko-bot
2026-11-02  7:40 ` [PATCH 6/6] perf/x86/intel/pt: Stop tracing across system suspend Adrian Hunter
2026-11-02  8:59   ` sashiko-bot
2026-11-03 15:57     ` Adrian Hunter [this message]
2026-11-02 10:10 ` [PATCH 0/6] perf/x86/intel/pt: Fix tracing across kexec, kdump and suspend Peter Zijlstra
2026-11-02 12:22   ` Adrian Hunter

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=1cb49f46-9453-4ea2-adb1-e78575837d09@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.