Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf: Identify the 0->1 transition for event::mmap_count

Needed because refcount_inc() doesn't allow the 0->1 transition.

Specifically, this is the case where we've created the RB, this means
there was no RB, and as such there could not have been an mmap.
Additionally we hold mmap_mutex to serialize everything.

This must be the first.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250812104019.956479989@infradead.org

+1 -1
+1 -1
kernel/events/core.c
··· 7034 7034 perf_event_update_userpage(event); 7035 7035 7036 7036 perf_mmap_account(vma, user_extra, extra); 7037 - atomic_inc(&event->mmap_count); 7037 + atomic_set(&event->mmap_count, 1); 7038 7038 7039 7039 return 0; 7040 7040 }