linux/kernel/trace
Steven Rostedt 3eefae994d ftrace: limit trace entries
Currently there is no protection from the root user to use up all of
memory for trace buffers. If the root user allocates too many entries,
the OOM killer might start kill off all tasks.

This patch adds an algorith to check the following condition:

 pages_requested > (freeable_memory + current_trace_buffer_pages) / 4

If the above is met then the allocation fails. The above prevents more
than 1/4th of freeable memory from being used by trace buffers.

To determine the freeable_memory, I made determine_dirtyable_memory in
mm/page-writeback.c global.

Special thanks goes to Peter Zijlstra for suggesting the above calculation.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-23 22:05:14 +02:00
..
ftrace.c ftrace: use raw_smp_processor_id for mcount functions 2008-05-23 22:01:34 +02:00
Kconfig ftrace: restrict tracing to HAVE_FTRACE architectures 2008-05-23 21:15:29 +02:00
Makefile ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00
trace_functions.c ftrace: fix comm on function trace output 2008-05-23 21:52:12 +02:00
trace_irqsoff.c ftrace: irqsoff use raw_smp_processor_id 2008-05-23 21:13:41 +02:00
trace_sched_switch.c ftrace: fix comm on function trace output 2008-05-23 21:52:12 +02:00
trace_sched_wakeup.c ftrace: printk and trace irqsoff and wakeups 2008-05-23 21:13:02 +02:00
trace_selftest_dynamic.c ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00
trace_selftest.c ftrace: user proper API for setting RT prios in selftest 2008-05-23 21:49:42 +02:00
trace.c ftrace: limit trace entries 2008-05-23 22:05:14 +02:00
trace.h ftrace: add readpos to struct trace_seq; add trace_seq_to_user() 2008-05-23 22:02:13 +02:00