[PATCH 1/2] perf: Fix AUX software double buffering

From: Alexander Shishkin
Date: Fri May 03 2019 - 04:56:14 EST


Commit 5768402fd9c6e87 ("perf/ring_buffer: Use high order allocations for
AUX buffers optimistically") overlooked the fact that the previous one page
granularity of the AUX buffer provided an implicit double buffering
capability to the PMU driver, which went away when the entire buffer became
one high-order page.

Always make the full-trace mode AUX allocation at least two-part to preserve
the previous behavior and allow the implicit double buffering to continue.

Signed-off-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Fixes: 5768402fd9c6e87 ("perf/ring_buffer: Use high order allocations for AUX buffers optimistically")
Reported-by: Ammy Yi <ammy.yi@xxxxxxxxx>
---
kernel/events/ring_buffer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index 5eedb49a65ea..674b35383491 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -610,8 +610,7 @@ int rb_alloc_aux(struct ring_buffer *rb, struct perf_event *event,
* PMU requests more than one contiguous chunks of memory
* for SW double buffering
*/
- if ((event->pmu->capabilities & PERF_PMU_CAP_AUX_SW_DOUBLEBUF) &&
- !overwrite) {
+ if (!overwrite) {
if (!max_order)
return -EINVAL;

--
2.20.1