Skip to contentSkip to conversation

perf: Update the mmap control page on mmap()

tip:perf/fast tip-bot for Peter Zijlstra 1 participant 1 message Dec 21, 2011 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  9a0f05cb36888550d1509d60aa55788615abea44
Gitweb:     http://git.kernel.org/tip/9a0f05cb36888550d1509d60aa55788615abea44
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Mon, 21 Nov 2011 15:13:29 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 21 Dec 2011 11:01:05 +0100

perf: Update the mmap control page on mmap()

Apparently we didn't update the mmap control page right after mmap(), which leads to surprises when userspace wants to use it.

---
 kernel/events/core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
kernel/events/core.c +2 -0
index 2f8f3f1..0ca1f64 100644
@@ -3534,6 +3534,8 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
 	event->mmap_user = get_current_user();
 	vma->vm_mm->pinned_vm += event->mmap_locked;
 
+	perf_event_update_userpage(event);
+
 unlock:
 	if (!ret)
 		atomic_inc(&event->mmap_count);