diff options
-rw-r--r-- | include/linux/perf_event.h | 2 | ||||
-rw-r--r-- | kernel/perf_event.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 7cd7b356447..7098ebbb3b3 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -599,7 +599,7 @@ struct perf_mmap_data { local_t head; /* write position */ local_t nest; /* nested writers */ local_t events; /* event limit */ - local_t wakeup; /* needs a wakeup */ + local_t wakeup; /* wakeup stamp */ local_t lost; /* nr records lost */ long watermark; /* wakeup watermark */ diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 7a932526946..1531e0b409a 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; |