From: Thomas Gleixner Date: Tue, 12 Aug 2025 10:38:59 +0000 (+0200) Subject: perf: Remove redundant condition for AUX buffer size X-Git-Tag: v6.18-rc1~196^2~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8c4f6ee8eeed8e02800bed6afb9aa22fc3476a1;p=thirdparty%2Fkernel%2Fstable.git perf: Remove redundant condition for AUX buffer size 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 separate functions, so that only nr_pages needs to be handed in. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Lorenzo Stoakes Link: https://lore.kernel.org/r/20250812104018.424519320@infradead.org --- diff --git a/kernel/events/core.c b/kernel/events/core.c index 8060c2857bb2b..eea3a7d6c61d7 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -7043,7 +7043,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma) 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 */