[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170905133026.13689-2-alexander.shishkin@linux.intel.com>
Date: Tue, 5 Sep 2017 16:30:10 +0300
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
acme@...hat.com, kirill.shutemov@...ux.intel.com,
Borislav Petkov <bp@...en8.de>, rric@...nel.org,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: [RFC PATCH 01/17] perf: Allow mmapping only user page
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@...ux.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
Powered by blists - more mailing lists