mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linuxfoundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Kees Cook <kees@kernel.org>
Subject: [patch 1/6] perf/core: Remove redundant condition for AUX buffer size
Date: Wed,  6 Aug 2025 22:12:54 +0200 (CEST)	[thread overview]
Message-ID: <20250806200617.258754928@linutronix.de> (raw)
In-Reply-To: <20250806195624.880096284@linutronix.de>

It is already checked whether the VMA size is the same as
nr_pages * PAGE_SIZE, so later checking both:

      aux_size == vma_size && aux_size == nr_pages * PAGE_SIZE

is redundant. Remove the vma_size check as nr_pages is what is actually
used in the allocation function. That prepares for splitting out the buffer
allocation into seperate functions, so that only nr_pages needs to be
handed in.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/events/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7043,7 +7043,7 @@ static int perf_mmap(struct file *file,
 		if (rb_has_aux(rb) && rb->aux_pgoff != vma->vm_pgoff)
 			goto aux_unlock;
 
-		if (aux_size != vma_size || aux_size != nr_pages * PAGE_SIZE)
+		if (aux_size != nr_pages * PAGE_SIZE)
 			goto aux_unlock;
 
 		/* already mapped with a different size */


  reply	other threads:[~2025-08-06 20:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06 20:12 [patch 0/6] perf: Convert mmap() related reference counts to refcount_t Thomas Gleixner
2025-08-06 20:12 ` Thomas Gleixner [this message]
2025-08-07 13:30   ` [patch 1/6] perf/core: Remove redundant condition for AUX buffer size Lorenzo Stoakes
2025-08-06 20:12 ` [patch 2/6] perf/core: Split out mlock limit handling Thomas Gleixner
2025-08-07 14:14   ` Lorenzo Stoakes
2025-08-06 20:12 ` [patch 3/6] perf/core: Split out VM accounting Thomas Gleixner
2025-08-07 14:25   ` Lorenzo Stoakes
2025-08-06 20:12 ` [patch 4/6] perf/core: Split out ringbuffer allocation Thomas Gleixner
2025-08-07 15:38   ` Lorenzo Stoakes
2025-08-11  6:26     ` Thomas Gleixner
2025-08-06 20:13 ` [patch 5/6] perf/core: Split the ringbuffer mmap() and allocation code out Thomas Gleixner
2025-08-06 20:13 ` [patch 6/6] perf/core: Convert mmap() refcounts to refcount_t Thomas Gleixner
2025-08-07 15:39 ` [patch 0/6] perf: Convert mmap() related reference counts " Lorenzo Stoakes

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=20250806200617.258754928@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=acme@redhat.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linuxfoundation.org \
    /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®