From: Leo Yan <leo.yan@arm.com>
To: James Clark <james.clark@linaro.org>
Cc: Will Deacon <will@kernel.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Peter Zijlstra <peterz@infradead.org>,
Mike Leach <mike.leach@arm.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Tamas Petz <tamas.petz@arm.com>,
Tamas Zsoldos <tamas.zsoldos@arm.com>,
Michiel van Tol <michiel.vantol@arm.com>,
Dev Jain <dev.jain@arm.com>, David Hildenbrand <david@kernel.org>,
Yabin Cui <yabinc@google.com>,
coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/2] perf: arm_spe: Prefer large AUX mappings
Date: Tue, 11 Aug 2026 11:17:42 +0100 [thread overview]
Message-ID: <20260811101742.GE15499@e132581.arm.com> (raw)
In-Reply-To: <8c8f6c2a-8fc2-4181-87fa-e64101dfce6f@linaro.org>
On Tue, Aug 11, 2026 at 10:02:44AM +0100, James Clark wrote:
[...]
> > The question is how "allocating contiguous AUX pages unnecessarily
> > exacerbates memory fragmentation." The relevant information I could find
> > is [1]:
> >
> > "On Android, we collect ETM data periodically on internal user devices
> > for AutoFDO optimization (for both userspace libraries and the
> > kernel). Allocating a large chunk of contiguous AUX pages (4M for each
> > CPU) periodically is almost unbearable. The kernel may need to kill
> > many processes to fulfill the request. It affects user experience even
> > after using PMU."
> >
>
> This sounds like it could be an attribute to perf_event_open. We can do
> PREFER_LARGE by default for performance and fewer discontinuities, but on
> Android or small systems users can enable an option to revert back to single
> pages.
>
> Or can this bit be determined at allocation time: "The kernel may need to
> kill many processes to fulfill the request"? If this memory pressure exists
> on allocation then do it one way, if not do it the other way.
Be careful with "The kernel may need to kill many processes ...".
The AUX allocator uses:
#define PERF_AUX_GFP (GFP_KERNEL | __GFP_ZERO | __GFP_NOWARN | __GFP_NORETRY)
Documentation/core-api/memory-allocation.rst says that __GFP_NORETRY
causes the allocator to "fail early rather than cause disruptive
reclaim" and that "the OOM killer is not invoked".
Therefore, it is unlikely to me that AUX allocation itself would cause
the kernel OOM killer to kill processes in order to satisfy the request.
I am a bit suspect the original observation was related to Android's
lmkd [1], where allocating the AUX buffers increased overall memory
pressure and indirectly caused processes to be killed. If so, I think it
is important to understand what actually triggered those kills.
Thanks,
Leo
[1] https://source.android.com/docs/core/perf/lmkd?hl=en&utm_source=chatgpt.com
prev parent reply other threads:[~2026-08-11 10:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 14:44 [PATCH 0/2] perf/arm: Prefer large AUX mappings for CoreSight and SPE Leo Yan
2026-08-10 14:44 ` [PATCH 1/2] coresight: perf: Prefer large AUX mappings Leo Yan
2026-08-10 14:44 ` [PATCH 2/2] perf: arm_spe: " Leo Yan
2026-08-10 15:10 ` Will Deacon
2026-08-10 17:41 ` Leo Yan
2026-08-11 9:02 ` James Clark
2026-08-11 10:17 ` Leo Yan [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=20260811101742.GE15499@e132581.arm.com \
--to=leo.yan@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=coresight@lists.linaro.org \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=james.clark@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=michiel.vantol@arm.com \
--cc=mike.leach@arm.com \
--cc=peterz@infradead.org \
--cc=suzuki.poulose@arm.com \
--cc=tamas.petz@arm.com \
--cc=tamas.zsoldos@arm.com \
--cc=will@kernel.org \
--cc=yabinc@google.com \
/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