ring-buffer: prevent false positive warning
authorSteven Rostedt <srostedt@redhat.com>
Tue, 23 Dec 2008 16:32:25 +0000 (11:32 -0500)
committerIngo Molnar <mingo@elte.hu>
Tue, 23 Dec 2008 17:45:26 +0000 (18:45 +0100)
commit98db8df777438e16ad0f44a0fba05ebbdb73db8d
treef2cde3dbe3000f4bafd0c42df43f736b7e5a648b
parenta8ccf1d6f60e3e6ae63122e02378cd4d40dd4aac
ring-buffer: prevent false positive warning

Impact: eliminate false WARN_ON message

If an interrupt goes off after the setting of the local variable
tail_page and before incrementing the write index of that page,
the interrupt could push the commit forward to the next page.

Later a check is made to see if interrupts pushed the buffer around
the entire ring buffer by comparing the next page to the last commited
page. This can produce a false positive if the interrupt had pushed
the commit page forward as stated above.

Thanks to Jiaying Zhang for finding this race.

Reported-by: Jiaying Zhang <jiayingz@google.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/ring_buffer.c