Ubuntu-focal-kernel/kernel/trace
Zheng Yejian 8a7b6399c4 tracing: Avoid possible softlockup in tracing_iter_reset()
BugLink: https://bugs.launchpad.net/bugs/2081278

[ Upstream commit 49aa8a1f4d6800721c7971ed383078257f12e8f9 ]

In __tracing_open(), when max latency tracers took place on the cpu,
the time start of its buffer would be updated, then event entries with
timestamps being earlier than start of the buffer would be skipped
(see tracing_iter_reset()).

Softlockup will occur if the kernel is non-preemptible and too many
entries were skipped in the loop that reset every cpu buffer, so add
cond_resched() to avoid it.

Cc: stable@vger.kernel.org
Fixes: 2f26ebd549 ("tracing: use timestamp to determine start of latency traces")
Link: https://lore.kernel.org/20240827124654.3817443-1-zhengyejian@huaweicloud.com
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Zheng Yejian <zhengyejian@huaweicloud.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-09-27 10:50:34 +02:00
..
Kconfig
Makefile
blktrace.c
bpf_trace.c bpf: Clear the probe_addr for uprobe 2023-10-30 11:42:07 +01:00
fgraph.c
ftrace.c ftrace: Fix possible warning on checking all pages used in ftrace_process_locs() 2023-10-30 11:41:45 +01:00
ftrace_internal.h
power-traces.c
preemptirq_delay_test.c tracing: Add MODULE_DESCRIPTION() to preemptirq_delay_test 2024-08-02 16:16:19 +02:00
ring_buffer.c ring-buffer: Rename ring_buffer_read() to read_buffer_iter_advance() 2024-09-27 10:50:34 +02:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Avoid possible softlockup in tracing_iter_reset() 2024-09-27 10:50:34 +02:00
trace.h tracing: Have trace_event_file have ref counters 2024-02-02 14:13:12 +01:00
trace_benchmark.c
trace_benchmark.h
trace_branch.c
trace_clock.c
trace_dynevent.c
trace_dynevent.h
trace_entries.h
trace_event_perf.c tracing: Show size of requested perf buffer 2024-06-07 15:01:46 +02:00
trace_events.c tracing: Have trace_event_file have ref counters 2024-02-02 14:13:12 +01:00
trace_events_filter.c tracing: Have trace_event_file have ref counters 2024-02-02 14:13:12 +01:00
trace_events_filter_test.h
trace_events_hist.c tracing/histograms: Return an error if we fail to add histogram to hist_vars list 2023-10-02 12:12:16 +02:00
trace_events_trigger.c Revert "tracing/trigger: Fix to return error if failed to alloc snapshot" 2024-06-07 15:01:43 +02:00
trace_export.c
trace_functions.c
trace_functions_graph.c ring-buffer: Rename ring_buffer_read() to read_buffer_iter_advance() 2024-09-27 10:50:34 +02:00
trace_hwlat.c
trace_irqsoff.c tracing: Fix memleak due to race between current_tracer and trace 2023-10-30 11:42:01 +01:00
trace_kdb.c
trace_kprobe.c tracing/probes: Have process_fetch_insn() take a void * instead of pt_regs 2023-10-30 11:41:57 +01:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_output.c tracing: Add size check when printing trace_marker output 2024-02-29 15:23:33 +01:00
trace_output.h
trace_preemptirq.c
trace_printk.c
trace_probe.c
trace_probe.h
trace_probe_tmpl.h tracing/probes: Fix to update dynamic data counter if fetcharg uses it 2023-10-30 11:41:57 +01:00
trace_sched_switch.c
trace_sched_wakeup.c tracing: Fix memleak due to race between current_tracer and trace 2023-10-30 11:42:01 +01:00
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_uprobe.c bpf: Clear the probe_addr for uprobe 2023-10-30 11:42:07 +01:00
tracing_map.c tracing: Fix overflow in get_free_elt() 2024-09-27 10:50:21 +02:00
tracing_map.h