]> git.baikalelectronics.ru Git - kernel.git/commit
ring-buffer: prevent adding write in discarded area
authorSteven Rostedt <srostedt@redhat.com>
Thu, 11 Jun 2009 15:12:00 +0000 (11:12 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 15 Jun 2009 15:37:19 +0000 (11:37 -0400)
commitcdf34b881e5533e6eabc25ba96118bdcee9ddd7a
treeb43f113aa02063362d2e0f984d29c78afae87a02
parentb5f7e76f4c6584fe75996cc908a3d5289ae25083
ring-buffer: prevent adding write in discarded area

This a very tight race where an interrupt could come in and not
have enough data to put into the end of a buffer page, and that
it would fail to write and need to go to the next page.

But if this happened when another writer was about to reserver
their data, and that writer has smaller data to reserve, then
it could succeed even though the interrupt moved the tail page.

To pervent that, if we fail to store data, and by subtracting the
amount we reserved we still have room for smaller data, we need
to fill that space with "discarded" data.

[ Impact: prevent race were buffer data may be lost ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c