In rb_allocate_cpu_buffer(), bpage->order was omitted, leaving it as 0. This is an issue for a ring-buffer with subbufs bigger than PAGE_SIZE if when freed: free_buffer_page() relies on this value. Align the value with the actual allocation size (buffer::subbuf_order).
Unified · Split
| @@ -2510,6 +2510,7 @@ rb_allocate_cpu_buffer(struct trace_buffer *buffer, long nr_pages, int cpu) · 2509 unmodified lines | ||
| 2510 | 2510 | bpage = alloc_cpu_page(cpu); |
| 2511 | 2511 | if (!bpage) |
| 2512 | 2512 | return NULL; |
| 2513 | + bpage->order = cpu_buffer->buffer->subbuf_order; | |
| 2513 | 2514 | |
| 2514 | 2515 | rb_check_bpage(cpu_buffer, bpage); |
| 2515 | 2516 | |