[RFC][PATCH 1/6] perf: Update the mmap control page on mmap()

From: Peter Zijlstra
Date: Mon Nov 21 2011 - 09:56:49 EST


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

Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Cc: Arun Sharma <asharma@xxxxxx>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
kernel/events/core.c | 2 ++
1 file changed, 2 insertions(+)
Index: linux-2.6/kernel/events/core.c
===================================================================
--- linux-2.6.orig/kernel/events/core.c
+++ linux-2.6/kernel/events/core.c
@@ -3463,6 +3463,8 @@ static int perf_mmap(struct file *file,
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);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/