Skip to content

Commit

Permalink
ring-buffer: change WARN_ON from checking preempt_count to preemptible
Browse files Browse the repository at this point in the history
There's a WARN_ON in the ring buffer code that makes sure preemption
is disabled. It checks "!preempt_count()". But when CONFIG_PREEMPT is not
enabled, preempt_count() is always zero, and this will trigger the warning.

[ Impact: prevent false warning on non preemptible kernels ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed May 8, 2009
1 parent 7da3046 commit 74f4fd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ void ring_buffer_discard_commit(struct ring_buffer *buffer,
* committed yet. Thus we can assume that preemption
* is still disabled.
*/
RB_WARN_ON(buffer, !preempt_count());
RB_WARN_ON(buffer, preemptible());

cpu = smp_processor_id();
cpu_buffer = buffer->buffers[cpu];
Expand Down

0 comments on commit 74f4fd2

Please sign in to comment.