Skip to content

Commit f21f7fa

Browse files
committed
Merge tag 'trace-v4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Steven writes: "Vaibhav Nagarnaik found that modifying the ring buffer size could cause a huge latency in the system because it does a while loop to free pages without releasing the CPU (on non preempt kernels). In a case where there are hundreds of thousands of pages to free it could actually cause a system stall. A properly place cond_resched() solves this issue."
2 parents eba2d6b + 83f3655 commit f21f7fa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/trace/ring_buffer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,8 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages)
15461546
tmp_iter_page = first_page;
15471547

15481548
do {
1549+
cond_resched();
1550+
15491551
to_remove_page = tmp_iter_page;
15501552
rb_inc_page(cpu_buffer, &tmp_iter_page);
15511553

0 commit comments

Comments
 (0)