Commit fb6d032
tracing: Freeable reserved ring buffer
Make the ring buffer on reserved memory to be freeable. This allows us
to free the trace instance on the reserved memory without changing
cmdline and rebooting. Even if we can not change the kernel cmdline
for security reason, we can release the reserved memory for the ring
buffer as free (available) memory.
For example, boot kernel with reserved memory;
"reserve_mem=20M:2M:trace trace_instance=boot_mapped^traceoff@trace"
~ # free
total used free shared buff/cache available
Mem: 1995548 50544 1927568 14964 17436 1911480
Swap: 0 0 0
~ # rmdir /sys/kernel/tracing/instances/boot_mapped/
[ 23.704023] Freeing reserve_mem:trace memory: 20476K
~ # free
total used free shared buff/cache available
Mem: 2016024 41844 1956740 14968 17440 1940572
Swap: 0 0 0
Cc: Mark Rutland <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Mike Rapoport <[email protected]>
Link: https://lore.kernel.org/173989134814.230693.18199312930337815629.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>1 parent 74e2498 commit fb6d032
2 files changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9479 | 9479 | | |
9480 | 9480 | | |
9481 | 9481 | | |
| 9482 | + | |
| 9483 | + | |
| 9484 | + | |
9482 | 9485 | | |
9483 | 9486 | | |
9484 | 9487 | | |
| |||
9640 | 9643 | | |
9641 | 9644 | | |
9642 | 9645 | | |
| 9646 | + | |
9643 | 9647 | | |
9644 | 9648 | | |
9645 | 9649 | | |
| |||
9766 | 9770 | | |
9767 | 9771 | | |
9768 | 9772 | | |
| 9773 | + | |
| 9774 | + | |
| 9775 | + | |
| 9776 | + | |
| 9777 | + | |
9769 | 9778 | | |
9770 | 9779 | | |
9771 | 9780 | | |
| |||
10590 | 10599 | | |
10591 | 10600 | | |
10592 | 10601 | | |
| 10602 | + | |
10593 | 10603 | | |
10594 | 10604 | | |
10595 | 10605 | | |
| |||
10646 | 10656 | | |
10647 | 10657 | | |
10648 | 10658 | | |
| 10659 | + | |
10649 | 10660 | | |
10650 | 10661 | | |
10651 | 10662 | | |
| |||
10682 | 10693 | | |
10683 | 10694 | | |
10684 | 10695 | | |
10685 | | - | |
| 10696 | + | |
10686 | 10697 | | |
10687 | 10698 | | |
10688 | 10699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
0 commit comments