Commit 1b959e18 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

ring-buffer: remove unnecessary cpu_relax

The loops in the ring buffer that use cpu_relax are not dependent on
other CPUs. They simply came across some padding in the ring buffer and
are skipping over them. It is a normal loop and does not require a
cpu_relax.
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 98277991
...@@ -3132,10 +3132,8 @@ ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts) ...@@ -3132,10 +3132,8 @@ ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts)
spin_unlock(&cpu_buffer->reader_lock); spin_unlock(&cpu_buffer->reader_lock);
local_irq_restore(flags); local_irq_restore(flags);
if (event && event->type_len == RINGBUF_TYPE_PADDING) { if (event && event->type_len == RINGBUF_TYPE_PADDING)
cpu_relax();
goto again; goto again;
}
return event; return event;
} }
...@@ -3160,10 +3158,8 @@ ring_buffer_iter_peek(struct ring_buffer_iter *iter, u64 *ts) ...@@ -3160,10 +3158,8 @@ ring_buffer_iter_peek(struct ring_buffer_iter *iter, u64 *ts)
event = rb_iter_peek(iter, ts); event = rb_iter_peek(iter, ts);
spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags); spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
if (event && event->type_len == RINGBUF_TYPE_PADDING) { if (event && event->type_len == RINGBUF_TYPE_PADDING)
cpu_relax();
goto again; goto again;
}
return event; return event;
} }
...@@ -3209,10 +3205,8 @@ ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts) ...@@ -3209,10 +3205,8 @@ ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts)
out: out:
preempt_enable(); preempt_enable();
if (event && event->type_len == RINGBUF_TYPE_PADDING) { if (event && event->type_len == RINGBUF_TYPE_PADDING)
cpu_relax();
goto again; goto again;
}
return event; return event;
} }
...@@ -3302,10 +3296,8 @@ ring_buffer_read(struct ring_buffer_iter *iter, u64 *ts) ...@@ -3302,10 +3296,8 @@ ring_buffer_read(struct ring_buffer_iter *iter, u64 *ts)
out: out:
spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags); spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
if (event && event->type_len == RINGBUF_TYPE_PADDING) { if (event && event->type_len == RINGBUF_TYPE_PADDING)
cpu_relax();
goto again; goto again;
}
return event; return event;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment