diff options
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/ring_buffer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index d03f4f44a823..76f34c0ef29c 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -962,12 +962,15 @@ static struct ring_buffer_event * | |||
962 | __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, | 962 | __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, |
963 | unsigned type, unsigned long length, u64 *ts) | 963 | unsigned type, unsigned long length, u64 *ts) |
964 | { | 964 | { |
965 | struct buffer_page *tail_page, *head_page, *reader_page; | 965 | struct buffer_page *tail_page, *head_page, *reader_page, *commit_page; |
966 | unsigned long tail, write; | 966 | unsigned long tail, write; |
967 | struct ring_buffer *buffer = cpu_buffer->buffer; | 967 | struct ring_buffer *buffer = cpu_buffer->buffer; |
968 | struct ring_buffer_event *event; | 968 | struct ring_buffer_event *event; |
969 | unsigned long flags; | 969 | unsigned long flags; |
970 | 970 | ||
971 | commit_page = cpu_buffer->commit_page; | ||
972 | /* we just need to protect against interrupts */ | ||
973 | barrier(); | ||
971 | tail_page = cpu_buffer->tail_page; | 974 | tail_page = cpu_buffer->tail_page; |
972 | write = local_add_return(length, &tail_page->write); | 975 | write = local_add_return(length, &tail_page->write); |
973 | tail = write - length; | 976 | tail = write - length; |
@@ -993,7 +996,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, | |||
993 | * it all the way around the buffer, bail, and warn | 996 | * it all the way around the buffer, bail, and warn |
994 | * about it. | 997 | * about it. |
995 | */ | 998 | */ |
996 | if (unlikely(next_page == cpu_buffer->commit_page)) { | 999 | if (unlikely(next_page == commit_page)) { |
997 | WARN_ON_ONCE(1); | 1000 | WARN_ON_ONCE(1); |
998 | goto out_unlock; | 1001 | goto out_unlock; |
999 | } | 1002 | } |