linux-stable/kernel/trace
Shiju Jose b7d5fa8052 tracing: Fix poll() and select() do not work on per_cpu trace_pipe and trace_pipe_raw
commit 3e46d910d8 upstream.

poll() and select() on per_cpu trace_pipe and trace_pipe_raw do not work
since kernel 6.1-rc6. This issue is seen after the commit
42fb0a1e84 ("tracing/ring-buffer: Have
polling block on watermark").

This issue is firstly detected and reported, when testing the CXL error
events in the rasdaemon and also erified using the test application for poll()
and select().

This issue occurs for the per_cpu case, when calling the ring_buffer_poll_wait(),
in kernel/trace/ring_buffer.c, with the buffer_percent > 0 and then wait until the
percentage of pages are available. The default value set for the buffer_percent is 50
in the kernel/trace/trace.c.

As a fix, allow userspace application could set buffer_percent as 0 through
the buffer_percent_fops, so that the task will wake up as soon as data is added
to any of the specific cpu buffer.

Link: https://lore.kernel.org/linux-trace-kernel/20230202182309.742-2-shiju.jose@huawei.com

Cc: <mhiramat@kernel.org>
Cc: <mchehab@kernel.org>
Cc: <linux-edac@vger.kernel.org>
Cc: stable@vger.kernel.org
Fixes: 42fb0a1e84 ("tracing/ring-buffer: Have polling block on watermark")
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-15 17:22:22 +01:00
..
blktrace.c blktrace: Fix output non-blktrace event when blk_classic option enabled 2023-01-14 10:15:41 +01:00
bpf_trace.c bpf: Fix a possible task gone issue with bpf_send_signal[_thread]() helpers 2023-02-15 17:22:10 +01:00
bpf_trace.h
fgraph.c fgraph: Initialize tracing_graph_pause at task creation 2021-02-10 09:29:16 +01:00
ftrace.c ftrace: Fix null pointer dereference in ftrace_add_mod() 2022-11-25 17:45:48 +01:00
ftrace_internal.h
Kconfig tracing/kprobes: Do the notrace functions check without kprobes on ftrace 2021-01-19 18:27:19 +01:00
kprobe_event_gen_test.c tracing: kprobe: Fix potential null-ptr-deref on trace_array in kprobe_event_gen_test_exit() 2022-11-25 17:45:49 +01:00
Makefile
power-traces.c
preemptirq_delay_test.c
ring_buffer.c ring-buffer: Include dropped pages in counting dirty patches 2022-11-25 17:45:54 +01:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event() 2022-11-25 17:45:49 +01:00
trace.c tracing: Fix poll() and select() do not work on per_cpu trace_pipe and trace_pipe_raw 2023-02-15 17:22:22 +01:00
trace.h tracing: Make sure trace_printk() can output as soon as it can be used 2023-02-01 08:23:22 +01:00
trace_benchmark.c
trace_benchmark.h
trace_boot.c tracing/boot: Fix a hist trigger dependency for boot time tracing 2021-09-22 12:28:03 +02:00
trace_branch.c
trace_clock.c tracing: Do no increment trace_clock_global() by one 2021-06-23 14:42:50 +02:00
trace_dynevent.c tracing: Free buffers when a used dynamic event is removed 2022-12-08 11:23:58 +01:00
trace_dynevent.h
trace_entries.h
trace_event_perf.c
trace_events.c tracing: Free buffers when a used dynamic event is removed 2022-12-08 11:23:58 +01:00
trace_events_filter.c tracing: Add ustring operation to filtering string pointers 2022-03-08 19:09:31 +01:00
trace_events_filter_test.h
trace_events_hist.c trace_events_hist: add check for return value of 'create_hist_field' 2023-02-01 08:23:22 +01:00
trace_events_inject.c
trace_events_synth.c tracing: Fix wild-memory-access in register_synth_event() 2022-11-25 17:45:49 +01:00
trace_events_trigger.c tracing: Dump stacktrace trigger to the corresponding instance 2022-04-27 13:53:46 +02:00
trace_export.c
trace_functions.c tracing: Have all levels of checks prevent recursion 2021-10-27 09:56:56 +02:00
trace_functions_graph.c
trace_hwlat.c
trace_irqsoff.c tracing: Use pause-on-trace with the latency tracers 2021-02-10 09:29:16 +01:00
trace_kdb.c
trace_kprobe.c tracing: Fix return value of __setup handlers 2022-03-08 19:09:38 +01:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_output.c tracing: Make sure trace_printk() can output as soon as it can be used 2023-02-01 08:23:22 +01:00
trace_output.h
trace_preemptirq.c tracing: hold caller_addr to hardirq_{enable,disable}_ip 2022-09-23 14:16:58 +02:00
trace_printk.c
trace_probe.c tracing/probes: Have kprobes and uprobes use $COMM too 2022-08-25 11:38:23 +02:00
trace_probe.h tracing/probes: Reject events which have the same name of existing one 2021-09-22 12:28:00 +02:00
trace_probe_tmpl.h
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_synth.h tracing: Synthetic event field_pos is an index not a boolean 2021-07-28 14:35:45 +02:00
trace_syscalls.c
trace_uprobe.c tracing/uprobe: Fix uprobe_perf_open probes iteration 2021-12-01 09:19:01 +01:00
tracing_map.c tracing: Fix a kmemleak false positive in tracing_map 2021-12-17 10:14:40 +01:00
tracing_map.h