summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/perf_event.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 7a93252..1531e0b 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -3056,8 +3056,8 @@ int perf_output_begin(struct perf_output_handle *handle,
handle->offset = offset;
handle->head = head;
- if (head - tail > data->watermark)
- local_inc(&data->wakeup);
+ if (head - local_read(&data->wakeup) > data->watermark)
+ local_add(data->watermark, &data->wakeup);
if (have_lost) {
lost_event.header.type = PERF_RECORD_LOST;