mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: James Clark <james.clark@linaro.org>
Cc: Puranjay Mohan <puranjay12@gmail.com>,
	vladimir.murzin@arm.com, Mark Rutland <mark.rutland@arm.com>,
	Will Deacon <will@kernel.org>,
	bpf@vger.kernel.org,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Rob Herring <robh@kernel.org>,
	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>,
	Shuah Khan <shuah@kernel.org>, Breno Leitao <leitao@debian.org>,
	Ravi Bangoria <ravi.bangoria@amd.com>,
	Stephane Eranian <eranian@google.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Usama Arif <usama.arif@linux.dev>,
	linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com, Andrii Nakryiko <andrii.nakryiko@gmail.com>
Subject: Re: [PATCH v6 0/3] arm64: Add BRBE support for bpf_get_branch_snapshot()
Date: Fri, 27 Nov 2026 11:11:28 +0000	[thread overview]
Message-ID: <20261127111128.GB861809@e132581.arm.com> (raw)
In-Reply-To: <9a471409-04c2-4f6e-aec9-0b23bb9b69f0@linaro.org>

On Fri, Nov 27, 2026 at 10:56:27AM +0000, James Clark wrote:

> > Could we restrict bpf_get_branch_snapshot() on arm64 to a free-running
> > BRBE mode? On a given CPU, at least one active event would have to
> > request a branch stack, and every such event would have to be a
> > counting event.

> Yeah I think this is a pretty good idea. It looks like it would avoid having
> to disable NMIs. You only need a local_irq_save() to avoid new events from
> reconfiguring BRBE while taking a snapshot, and you don't have to disable
> the PMU counters either.

I'd like to avoid local_irq_save() if we can protect BRBE snapshot
reentry in another way.

> If any sampling BRBE event gets scheduled then the snapshots just start
> skipping and returning empty.

BPF program can be attached to interrupt handlers (even it can be
attached to PMU interrupt handler). As you suggested, we can use per-CPU
flag to return an empty snapshot for the nested call.

Thanks,
Leo

  reply	other threads:[~2026-11-27 11:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 16:46 Puranjay Mohan
2026-08-10 16:46 ` [PATCH v6 1/3] arm64: Add raw variants of local_daif_save() and local_daif_restore() Puranjay Mohan
2026-08-10 16:46 ` [PATCH v6 2/3] perf/arm64: Add BRBE support for bpf_get_branch_snapshot() Puranjay Mohan
2026-11-26 17:19   ` Leo Yan
2026-11-27 10:56     ` James Clark
2026-08-10 16:46 ` [PATCH v6 3/3] selftests/bpf: Adjust entry thresholds for ARM64 BRBE Puranjay Mohan
2026-09-01 13:45 ` [PATCH v6 0/3] arm64: Add BRBE support for bpf_get_branch_snapshot() Puranjay Mohan
2026-09-22 20:40   ` Andrii Nakryiko
2026-09-23  9:15     ` James Clark
2026-09-23 16:46       ` Andrii Nakryiko
2026-11-26 12:39         ` James Clark
2026-11-26 18:02           ` Leo Yan
2026-11-27 10:56             ` James Clark
2026-11-27 11:11               ` Leo Yan [this message]
2026-11-27 11:24                 ` Leo Yan

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=20261127111128.GB861809@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=anshuman.khandual@arm.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=puranjay12@gmail.com \
    --cc=ravi.bangoria@amd.com \
    --cc=robh@kernel.org \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=usama.arif@linux.dev \
    --cc=vladimir.murzin@arm.com \
    --cc=will@kernel.org \
    --cc=yonghong.song@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 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®