1
0
Fork 0
remarkable-linux/kernel/trace
Vaibhav Nagarnaik 7eba38a3f6 ring-buffer: Allow for rescheduling when removing pages
commit 83f365554e upstream.

When reducing ring buffer size, pages are removed by scheduling a work
item on each CPU for the corresponding CPU ring buffer. After the pages
are removed from ring buffer linked list, the pages are free()d in a
tight loop. The loop does not give up CPU until all pages are removed.
In a worst case behavior, when lot of pages are to be freed, it can
cause system stall.

After the pages are removed from the list, the free() can happen while
the work is rescheduled. Call cond_resched() in the loop to prevent the
system hangup.

Link: http://lkml.kernel.org/r/20180907223129.71994-1-vnagarnaik@google.com

Cc: stable@vger.kernel.org
Fixes: 83f40318da ("ring-buffer: Make removal of ring buffer pages atomic")
Reported-by: Jason Behmer <jbehmer@google.com>
Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 03:06:04 -07:00
..
Kconfig tracing: Prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y 2018-02-22 15:42:13 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
blktrace.c tracing/blktrace: Fix to allow setting same value 2018-09-09 19:55:57 +02:00
bpf_trace.c bpf: fix corruption on concurrent perf_event_output calls 2017-12-25 14:26:31 +01:00
ftrace.c ftrace: Remove incorrect setting of glob search field 2018-02-16 20:23:11 +01:00
power-traces.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ring_buffer.c ring-buffer: Allow for rescheduling when removing pages 2018-09-29 03:06:04 -07:00
ring_buffer_benchmark.c ring-buffer: Have ring_buffer_alloc_read_page() return error on offline CPU 2017-08-02 14:23:02 -04:00
rpm-traces.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.c tracing: Do not call start/stop() functions when tracing_on does not change 2018-09-09 19:55:57 +02:00
trace.h tracing: Make the snapshot trigger work with instances 2018-06-05 11:41:56 +02:00
trace_benchmark.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_benchmark.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_branch.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_clock.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/clock.h> 2017-03-02 08:42:27 +01:00
trace_entries.h tracing: Fix missing tab for hwlat_detector print format 2018-04-29 11:33:17 +02:00
trace_event_perf.c perf/ftrace: Fix double traces of perf on ftrace:function 2017-08-29 13:29:29 +02:00
trace_events.c tracing: Fix converting enum's from the map in trace_event_eval_update() 2018-01-23 19:58:16 +01:00
trace_events_filter.c tracing: Fix regex_match_front() to not over compare the test string 2018-05-16 10:10:27 +02:00
trace_events_filter_test.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_events_hist.c tracing: Exclude 'generic fields' from histograms 2017-12-25 14:26:27 +01:00
trace_events_trigger.c tracing: Fix possible double free in event_enable_trigger_func() 2018-08-03 07:50:21 +02:00
trace_export.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_functions.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_functions_graph.c tracing: Fix missing return symbol in function_graph output 2018-07-11 16:29:14 +02:00
trace_hwlat.c trace: make trace_hwlat timestamp y2038 safe 2017-05-08 17:15:15 -07:00
trace_irqsoff.c clocksource: Use a plain u64 instead of cycle_t 2016-12-25 11:04:12 +01:00
trace_kdb.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_kprobe.c tracing: Quiet gcc warning about maybe unused link variable 2018-08-03 07:50:21 +02:00
trace_mmiotrace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_nop.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_output.c tracing: Reorder display of TGID to be after PID 2018-07-17 11:39:30 +02:00
trace_output.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_printk.c tracing: Handle NULL formats in hold_module_trace_bprintk_format() 2016-06-20 09:46:12 -04:00
trace_probe.c tracing: probeevent: Fix to support minus offset from symbol 2018-03-28 18:24:42 +02:00
trace_probe.h tracing: probeevent: Fix to support minus offset from symbol 2018-03-28 18:24:42 +02:00
trace_sched_switch.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_sched_wakeup.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_selftest.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_selftest_dynamic.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_seq.c tracing: use %*pb[l] to print bitmaps including cpumasks and nodemasks 2015-02-13 21:21:37 -08:00
trace_stack.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_stat.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_stat.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_syscalls.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_uprobe.c uprobes: Use synchronize_rcu() not synchronize_sched() 2018-09-09 19:55:58 +02:00
tracing_map.c tracing: Fix kmemleak in tracing_map_array_free() 2017-08-24 10:05:51 -04:00
tracing_map.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00