]> git.baikalelectronics.ru Git - kernel.git/commit
perf: Do not waste PAGE_SIZE bytes for ALIGN(8) in perf_event_mmap_event()
authorOleg Nesterov <oleg@redhat.com>
Wed, 16 Oct 2013 20:10:04 +0000 (22:10 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 29 Oct 2013 11:02:52 +0000 (12:02 +0100)
commitd7a7d871920d4a457f1151fa3aa957caca6a4047
tree47cbcc90d4daa2155c2a5f0ebd357a0499d78316
parent83c1e08b8de27a8a537970704a97a5b4081da0fb
perf: Do not waste PAGE_SIZE bytes for ALIGN(8) in perf_event_mmap_event()

perf_event_mmap_event() does kzalloc(PATH_MAX + sizeof(u64)) to
ensure we can align the size later. However this means that we
actually allocate PAGE_SIZE * 2 buffer, seems too much.

Change this code to allocate PATH_MAX==PAGE_SIZE bytes, but tell
d_path() to not use the last sizeof(u64) bytes.

Note: it is not clear why do we need __GFP_ZERO, see the next patch.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20131016201004.GC23214@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c