Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Leo Yan" <leo.yan@arm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf/aux: Avoid reclaim for optional higher-order allocations
Date: Mon, 09 Nov 2026 10:31:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-204821@kernel.org> (raw)
In-Reply-To: <20261109-perf_aux_alloc_optimize_psi-v1-1-d56ac4bf3ef5@arm.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] perf/core: memory leak of rb->aux_pages in rb_alloc_aux() [1]
--

commit 2dcf33d1db6176542401bc5d602eab44c1364ebb
Author: Leo Yan <leo.yan@arm.com>

perf/aux: Avoid reclaim for optional higher-order allocations

This commit clears __GFP_RECLAIM and adds __GFP_NOMEMALLOC for optional
higher-order AUX buffer allocations on scatter-gather PMUs, and switches
PERF_AUX_GFP from __GFP_NORETRY to __GFP_RETRY_MAYFAIL.

Link: https://lore.kernel.org/lkml/CALJ9ZPO9XxF-kz5K67Jg8RtpiEmK7XFU3e+xDak6LyV_We7yBQ@mail.gmail.com/

> diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
> index 95f4fbdfd2764..37bda4398724a 100644
> --- a/kernel/events/ring_buffer.c
> +++ b/kernel/events/ring_buffer.c

[ ... ]

> @@ -733,7 +743,7 @@ int rb_alloc_aux(struct perf_buffer *rb, struct perf_event *event,
>  		int last, order;
>  
>  		order = min(max_order, ilog2(nr_pages - rb->aux_nr_pages));
> -		page = rb_alloc_aux_page(node, order);
> +		page = rb_alloc_aux_page(node, order, no_sg);
>  		if (!page)
>  			goto out;

[Severity: Medium]
This problem wasn't introduced by this patch, but can rb_alloc_aux() leak
rb->aux_pages [1] when the first rb_alloc_aux_page() call fails?  At
that point rb->aux_nr_pages is still zero, and __rb_free_aux() only calls
kfree(rb->aux_pages) when rb->aux_nr_pages is non-zero.

[1] https://sashiko.dev/#/bug/linux-c1a2bb3b-5d2a-4fca-a697-ce07992a5cc1

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-perf_aux_alloc_optimize_psi-v1-1-d56ac4bf3ef5@arm.com?part=1

  reply	other threads:[~2026-11-09 10:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 10:21 [PATCH] perf/aux: Avoid reclaim for optional higher-order allocations Leo Yan
2026-11-09 10:31 ` sashiko-bot [this message]
2026-11-09 11:35   ` 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=sashiko-outbox-204821@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=leo.yan@arm.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.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