[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4fe85a3f-fea3-4364-a013-6eea1b69a341@lucifer.local>
Date: Wed, 13 Aug 2025 07:24:56 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: tglx@...utronix.de, linux-kernel@...r.kernel.org,
torvalds@...uxfoundation.org, mingo@...nel.org, namhyung@...nel.org,
acme@...hat.com, kees@...nel.org
Subject: Re: [PATCH v3 11/15] perf: Make RB allocation branch self sufficient
On Tue, Aug 12, 2025 at 12:39:09PM +0200, Peter Zijlstra wrote:
> Ensure @rb usage doesn't extend out of the branch block.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Nice to separate this out and make this bit clear.
I'm guessing you're holding off on putting the rb decl into the branch as
you intend in a future patch to separate out the rb branch too into a
helper like tglx's original did?
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
> ---
> kernel/events/core.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -7116,8 +7116,6 @@ static int perf_mmap(struct file *file,
> * multiple times.
> */
> ret = 0;
> - /* We need the rb to map pages. */
> - rb = event->rb;
> perf_mmap_account(vma, user_extra, extra);
> atomic_inc(&event->mmap_count);
> goto unlock;
> @@ -7136,8 +7134,6 @@ static int perf_mmap(struct file *file,
> goto unlock;
> }
>
> - WARN_ON(!rb && event->rb);
> -
> if (vma->vm_flags & VM_WRITE)
> flags |= RING_BUFFER_WRITABLE;
>
> @@ -7190,7 +7186,7 @@ static int perf_mmap(struct file *file,
> * full cleanup in this case and therefore does not invoke
> * vmops::close().
> */
> - ret = map_range(rb, vma);
> + ret = map_range(event->rb, vma);
> if (ret)
> perf_mmap_close(vma);
>
>
>
Powered by blists - more mailing lists