linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mi, Dapeng" <dapeng1.mi@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	Eranian Stephane <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Andrew Zaborowski <andrew.zaborowski@intel.com>,
	Dapeng Mi <dapeng1.mi@intel.com>
Subject: Re: [PATCH] perf/x86/intel: Use early_initcall() to hook bts_init()
Date: Fri, 11 Jul 2025 10:37:31 +0800	[thread overview]
Message-ID: <9c96ca51-70ef-43f2-be84-b6879dc4c79d@linux.intel.com> (raw)
In-Reply-To: <20250606111606.84350-1-dapeng1.mi@linux.intel.com>

Kindly ping.

@Peter, not sure you have bandwidth to review this change? Thanks.

On 6/6/2025 7:16 PM, Dapeng Mi wrote:
> After the commit 'd971342d38bf ("perf/x86/intel: Decouple BTS
>  initialization from PEBS initialization")' is introduced, x86_pmu.bts
> would initialized in bts_init() which is hooked by arch_initcall().
>
> Whereas init_hw_perf_events() is hooked by early_initcall(). Once the
> core PMU is initialized, nmi watchdog initialization is called
> immediately before bts_init() is called. It leads to the BTS buffer is
> not really initialized since bts_init() is not called and x86_pmu.bts is
> still false at that time. Worse, BTS buffer would never be initialized
> then unless all core PMU events are freed and reserve_ds_buffers()
> is called again.
>
> Thus aligning with init_hw_perf_events(), use early_initcall() to hook
> bts_init() to ensure x86_pmu.bts is initialized before nmi watchdog
> initialization.
>
> Fixes: d971342d38bf ("perf/x86/intel: Decouple BTS initialization from PEBS initialization")
> Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
> ---
>  arch/x86/events/intel/bts.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c
> index 9560f693fac0..f0d9729ed255 100644
> --- a/arch/x86/events/intel/bts.c
> +++ b/arch/x86/events/intel/bts.c
> @@ -642,4 +642,4 @@ static __init int bts_init(void)
>  
>  	return perf_pmu_register(&bts_pmu, "intel_bts", -1);
>  }
> -arch_initcall(bts_init);
> +early_initcall(bts_init);
>
> base-commit: e7d952cc39fca34386ec9f15f68cb2eaac01b5ae

      parent reply	other threads:[~2025-07-11  2:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06 11:16 [PATCH] perf/x86/intel: Use early_initcall() to hook bts_init() Dapeng Mi
2025-06-19  1:10 ` Mi, Dapeng
2025-07-11  2:37 ` Mi, Dapeng [this message]

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=9c96ca51-70ef-43f2-be84-b6879dc4c79d@linux.intel.com \
    --to=dapeng1.mi@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andrew.zaborowski@intel.com \
    --cc=dapeng1.mi@intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).