]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ring-buffer: Set the right timestamp in the slow path of __rb_reserve_next()
authorAndrea Righi <andrea.righi@canonical.com>
Sat, 28 Nov 2020 09:15:17 +0000 (10:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Dec 2020 12:22:06 +0000 (13:22 +0100)
commit68e17e0b384c1cf6355591fcc2d1be003fc31a86
tree338713e10305aa53ceea2e92fe87c767c28e5e76
parentfd3a46f25bb4ffc1f80fe1925a031a82982aeb14
ring-buffer: Set the right timestamp in the slow path of __rb_reserve_next()

commit 8785f51a17083eee7c37606079c6447afc6ba102 upstream.

In the slow path of __rb_reserve_next() a nested event(s) can happen
between evaluating the timestamp delta of the current event and updating
write_stamp via local_cmpxchg(); in this case the delta is not valid
anymore and it should be set to 0 (same timestamp as the interrupting
event), since the event that we are currently processing is not the last
event in the buffer.

Link: https://lkml.kernel.org/r/X8IVJcp1gRE+FJCJ@xps-13-7390
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lwn.net/Articles/831207
Fixes: a389d86f7fd0 ("ring-buffer: Have nested events still record running time stamp")
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ring_buffer.c