[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250225111805.GL11590@noisy.programming.kicks-ass.net>
Date: Tue, 25 Feb 2025 12:18:05 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Dapeng Mi <dapeng1.mi@...ux.intel.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>,
Eranian Stephane <eranian@...gle.com>, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org, Dapeng Mi <dapeng1.mi@...el.com>
Subject: Re: [Patch v2 12/24] perf/x86/intel: Allocate arch-PEBS buffer and
initialize PEBS_BASE MSR
On Tue, Feb 18, 2025 at 03:28:06PM +0000, Dapeng Mi wrote:
> Arch-PEBS introduces a new MSR IA32_PEBS_BASE to store the arch-PEBS
> buffer physical address. This patch allocates arch-PEBS buffer and then
> initialize IA32_PEBS_BASE MSR with the buffer physical address.
Not loving how this patch obscures the whole DS area thing and naming.
> @@ -624,13 +604,18 @@ static int alloc_pebs_buffer(int cpu)
> int max, node = cpu_to_node(cpu);
> void *buffer, *insn_buff, *cea;
>
> - if (!x86_pmu.ds_pebs)
> + if (!intel_pmu_has_pebs())
> return 0;
>
> - buffer = dsalloc_pages(bsiz, GFP_KERNEL, cpu);
> + buffer = dsalloc_pages(bsiz, preemptible() ? GFP_KERNEL : GFP_ATOMIC, cpu);
But this plain smells bad, what is this about?
> if (unlikely(!buffer))
> return -ENOMEM;
>
> + if (x86_pmu.arch_pebs) {
> + hwev->pebs_vaddr = buffer;
> + return 0;
> + }
> +
> /*
> * HSW+ already provides us the eventing ip; no need to allocate this
> * buffer then.
Powered by blists - more mailing lists