mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: Leo Yan <leo.yan@arm.com>
Cc: Yabin Cui <yabinc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Thomas Gleixner <tglx@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@arm.com>,
	James Clark <james.clark@linaro.org>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Tamas Petz <tamas.petz@arm.com>,
	Tamas Zsoldos <tamas.zsoldos@arm.com>,
	Michiel van Tol <michiel.vantol@arm.com>,
	coresight@lists.linaro.org, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Revert "perf/aux: Allocate non-contiguous AUX pages by default"
Date: Thu, 19 Nov 2026 13:13:23 +0530	[thread overview]
Message-ID: <5909a504-0534-4f6a-8925-bb18f24eca0e@arm.com> (raw)
In-Reply-To: <20261118165702.GX9176@e132581.arm.com>



On 18/11/26 10:27 pm, Leo Yan wrote:
> On Sun, Nov 15, 2026 at 08:32:16PM +0530, Dev Jain wrote:
> 
> [...]
> 
>>> 1. Make opportunistic high-order AUX allocations no-reclaim:
>>>    When !(event->pmu->capabilities & PERF_PMU_CAP_AUX_NO_SG) and
>>>    order > 0, clear __GFP_RECLAIM (and add __GFP_NOMEMALLOC, matching
>>>    SLUB's allocate_slab() and GFP_TRANSHUGE_LIGHT):
>>>
>>>      gfp_t gfp = PERF_AUX_GFP;
>>>
>>>      if (order && !has_no_sg)
>>>              gfp = (PERF_AUX_GFP | __GFP_NOMEMALLOC) & ~__GFP_RECLAIM;
>>
>> Thanks for your reply.
>>
>> This looks like the correct solution. Note commit 0e05a469c294
>> ("mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations")
>> post which the regression you report should reduce drastically. It only
>> removes GFP_DIRECT_RECLAIM flag, I assume you are seeing latency even
>> due to reclaim/compaction daemon wakeups.
>>
>> So instead of enhancing this commit even more by making a page-allocator
>> change, I would rather make your proposed change on the perf side to
>> keep it simple. This should completely solve the problem.
> 
> Thanks a lot, Dev!
> 
> The revert (526d945ad9c0) and 0e05a469c294 are now in mainline. My tests
> show significantly lower PSI on v7.4-rc3, consistent with the expected
> benefit of 0e05a469c294.
> 
> The following PSI some values are totals in milliseconds across runs
> 2-10 (nine runs), excluding the first run of each case to avoid
> glitches caused by its proximity to lauching the pressure workload:
> 
>   Memory usage    v7.4-rc1    v7.4-rc3    rc3 + perf patch [1]
>   90%                0.000       0.000               0.000
>   95%               21.781       0.000               2.061
>   100%              27.946       0.000               0.000
> 
> My perf patch [1] reduces pageoutrun and compact_daemon_wake, but
> increases pgscan_kswapd at 95%. The following totals compare v7.4-rc3

Exactly what I expected. I would say to not complicate with GFP_RETRY_MAYFAIL
and keep it simple.


> and v7.4-rc + my patch, also across runs 2-10:
> 
>   Usage    pageoutrun    compact_daemon_wake    pgscan_kswapd
>   90%        58 -> 0               57 -> 0       1,932 -> 0
>   95%         3 -> 2                2 -> 1       9,664 -> 148,079
>   100%       40 -> 1               40 -> 0      11,616 -> 1,918
> 
> I would wait for Yabin's testing before deciding whether to proceed
> with the additional perf changes. In my patch, changing order 0 to
> __GFP_RETRY_MAYFAIL needs care: it may reduce allocation failures when
> free memory is scarce, at the cost of longer reclaim stalls and
> higher PSI.
> 
> Yabin, could you test the current mainline (or backport
> 526d945ad9c0/0e05a469c294) and confirm whether it resolves the PSI issue
> on Android? If still see the reclaim pressure or observe AUX allocation
> failures, it may also be worth testing patch [1].
> 
> Thanks,
> Leo
> 
> [1] https://lore.kernel.org/lkml/20261109-perf_aux_alloc_optimize_psi-v1-1-d56ac4bf3ef5@arm.com/


  reply	other threads:[~2026-11-19  7:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25 16:24 Leo Yan
2026-10-26 10:14 ` James Clark
2026-10-29  6:56 ` Dev Jain
     [not found]   ` <CALJ9ZPNWcDtajO+Luhxe1K3af64mPRFQSjvfvNornyFFkam-+g@mail.gmail.com>
2026-11-03 20:46     ` Yabin Cui
2026-11-04 12:59       ` Will Deacon
2026-11-06  9:35         ` Leo Yan
2026-11-05 17:35       ` Leo Yan
2026-11-06  0:55         ` Yabin Cui
2026-11-15 15:02       ` Dev Jain
2026-11-18 16:57         ` Leo Yan
2026-11-19  7:43           ` Dev Jain [this message]
2026-11-06  9:50 ` [tip: perf/urgent] " tip-bot2 for 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=5909a504-0534-4f6a-8925-bb18f24eca0e@arm.com \
    --to=dev.jain@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=anshuman.khandual@arm.com \
    --cc=bp@alien8.de \
    --cc=coresight@lists.linaro.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@arm.com \
    --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=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tamas.petz@arm.com \
    --cc=tamas.zsoldos@arm.com \
    --cc=tglx@kernel.org \
    --cc=will@kernel.org \
    --cc=x86@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

all inboxes | Powered by JetHome®