lkml.org 
[lkml]   [2017]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 01/17] perf: Allow mmapping only user page
Date
The 'user page' contains offsets and sizes of data and aux areas of the
ring buffer. If a user wants to mmap a pre-existing buffer, they need to
know these in order to issue mmap()s with correct offsets and sizes.

This enables mmapping of the user page if the ring buffer already exists.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
kernel/events/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index cb7eaf0f91..9389e27cb0 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5366,7 +5366,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
again:
mutex_lock(&event->mmap_mutex);
if (event->rb) {
- if (event->rb->nr_pages != nr_pages) {
+ if (nr_pages && event->rb->nr_pages != nr_pages) {
ret = -EINVAL;
goto unlock;
}
--
2.14.1
\
 
 \ /
  Last update: 2017-09-05 15:32    [W:0.141 / U:7.708 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site