android_kernel_motorola_sm6375/kernel/trace
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Steven Rostedt (Google) ec59a13252 ring-buffer: Include dropped pages in counting dirty patches
[ Upstream commit 31029a8b2c7e656a0289194ef16415050ae4c4ac ]

The function ring_buffer_nr_dirty_pages() was created to find out how many
pages are filled in the ring buffer. There's two running counters. One is
incremented whenever a new page is touched (pages_touched) and the other
is whenever a page is read (pages_read). The dirty count is the number
touched minus the number read. This is used to determine if a blocked task
should be woken up if the percentage of the ring buffer it is waiting for
is hit.

The problem is that it does not take into account dropped pages (when the
new writes overwrite pages that were not read). And then the dirty pages
will always be greater than the percentage.

This makes the "buffer_percent" file inaccurate, as the number of dirty
pages end up always being larger than the percentage, event when it's not
and this causes user space to be woken up more than it wants to be.

Add a new counter to keep track of lost pages, and include that in the
accounting of dirty pages so that it is actually accurate.

Link: https://lkml.kernel.org/r/20221021123013.55fb6055@gandalf.local.home

Fixes: 2c2b0a78b3 ("ring-buffer: Add percentage of ring buffer full to wake up reader")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-25 17:42:20 +01:00
..
blktrace.c blktrace: Fix uaf in blk_trace access after removing by sysfs 2021-09-30 10:09:24 +02:00
bpf_trace.c
fgraph.c
ftrace.c ftrace: Fix null pointer dereference in ftrace_add_mod() 2022-11-25 17:42:17 +01:00
ftrace_internal.h
Kconfig
Makefile
power-traces.c
preemptirq_delay_test.c
ring_buffer.c ring-buffer: Include dropped pages in counting dirty patches 2022-11-25 17:42:20 +01:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Disable interrupt or preemption before acquiring arch_spinlock_t 2022-10-26 13:22:21 +02:00
trace.h tracing: Fix pid filtering when triggers are attached 2021-12-01 09:23:29 +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
trace_events.c tracing: Have filter accept "common_cpu" to be consistent 2022-08-25 11:18:19 +02:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c tracing/histograms: Fix memory leak problem 2022-07-21 20:59:16 +02:00
trace_events_trigger.c tracing: Dump stacktrace trigger to the corresponding instance 2022-04-27 13:50:45 +02:00
trace_export.c
trace_functions.c tracing: Have all levels of checks prevent recursion 2021-10-27 09:54:29 +02:00
trace_functions_graph.c
trace_hwlat.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c tracing: Fix return value of __setup handlers 2022-03-08 19:07:50 +01:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_output.c
trace_output.h
trace_preemptirq.c tracing: hold caller_addr to hardirq_{enable,disable}_ip 2022-09-28 11:03:57 +02:00
trace_printk.c
trace_probe.c tracing/probes: Have kprobes and uprobes use $COMM too 2022-08-25 11:18:39 +02:00
trace_probe.h tracing/probes: Reject events which have the same name of existing one 2021-09-22 12:26:43 +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_syscalls.c
trace_uprobe.c tracing/uprobe: Fix uprobe_perf_open probes iteration 2021-12-01 09:23:29 +01:00
tracing_map.c tracing: Fix a kmemleak false positive in tracing_map 2021-12-17 10:12:24 +01:00
tracing_map.h