1
0
Fork 0
alistair23-linux/kernel/trace
KOSAKI Motohiro ef710e100c tracing: Shrink max latency ringbuffer if unnecessary
Documentation/trace/ftrace.txt says

  buffer_size_kb:

        This sets or displays the number of kilobytes each CPU
        buffer can hold. The tracer buffers are the same size
        for each CPU. The displayed number is the size of the
        CPU buffer and not total size of all buffers. The
        trace buffers are allocated in pages (blocks of memory
        that the kernel uses for allocation, usually 4 KB in size).
        If the last page allocated has room for more bytes
        than requested, the rest of the page will be used,
        making the actual allocation bigger than requested.
        ( Note, the size may not be a multiple of the page size
          due to buffer management overhead. )

        This can only be updated when the current_tracer
        is set to "nop".

But it's incorrect. currently total memory consumption is
'buffer_size_kb x CPUs x 2'.

Why two times difference is there? because ftrace implicitly allocate
the buffer for max latency too.

That makes sad result when admin want to use large buffer. (If admin
want full logging and makes detail analysis). example, If admin
have 24 CPUs machine and write 200MB to buffer_size_kb, the system
consume ~10GB memory (200MB x 24 x 2). umm.. 5GB memory waste is
usually unacceptable.

Fortunatelly, almost all users don't use max latency feature.
The max latency buffer can be disabled easily.

This patch shrink buffer size of the max latency buffer if
unnecessary.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
LKML-Reference: <20100701104554.DA2D.A69D9226@jp.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-07-21 10:20:17 -04:00
..
Kconfig tracing: Remove ksym tracer 2010-07-15 23:59:33 +02:00
Makefile tracing: Remove ksym tracer 2010-07-15 23:59:33 +02:00
blktrace.c blktrace: Fix new kernel-doc warnings 2010-05-31 09:58:20 +02:00
ftrace.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
power-traces.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ring_buffer.c trace: Reorder struct ring_buffer_per_cpu to remove padding on 64bit 2010-07-20 21:58:44 -04:00
ring_buffer_benchmark.c ring-buffer: Make benchmark handle missed events 2010-04-27 13:26:58 -04:00
trace.c tracing: Shrink max latency ringbuffer if unnecessary 2010-07-21 10:20:17 -04:00
trace.h tracing: Shrink max latency ringbuffer if unnecessary 2010-07-21 10:20:17 -04:00
trace_branch.c tracing: Allow events to share their print functions 2010-05-14 14:20:32 -04:00
trace_clock.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace_entries.h tracing: Remove ksym tracer 2010-07-15 23:59:33 +02:00
trace_event_perf.c tracing: Use class->reg() for all registering of events 2010-06-28 21:13:14 -04:00
trace_events.c tracing: Allow to disable cmdline recording 2010-07-20 21:52:33 -04:00
trace_events_filter.c tracing: Remove test of NULL define_fields callback 2010-06-28 17:12:52 -04:00
trace_export.c tracing: Remove redundant raw_init callbacks 2010-06-28 17:12:53 -04:00
trace_functions.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace_functions_graph.c tracing/function-graph: Use correct string size for snprintf 2010-06-28 21:11:39 -04:00
trace_irqsoff.c tracing: Shrink max latency ringbuffer if unnecessary 2010-07-21 10:20:17 -04:00
trace_kprobe.c tracing/kprobes: Support "string" type 2010-07-05 15:54:45 -03:00
trace_mmiotrace.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
trace_nop.c tracing/ftrace: make nop-tracer use polling wait for events on pipe 2009-03-23 09:22:15 +01:00
trace_output.c tracing: Reduce latency and remove percpu trace_seq 2010-07-20 22:05:34 -04:00
trace_output.h tracing: Allow events to share their print functions 2010-05-14 14:20:32 -04:00
trace_printk.c tracing: Remove markers 2009-09-18 21:22:08 +02:00
trace_sched_switch.c tracing: Let tracepoints have data passed to tracepoint callbacks 2010-05-14 09:50:34 -04:00
trace_sched_wakeup.c tracing: Shrink max latency ringbuffer if unnecessary 2010-07-21 10:20:17 -04:00
trace_selftest.c tracing: Remove ksym tracer 2010-07-15 23:59:33 +02:00
trace_selftest_dynamic.c ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00
trace_stack.c tracing: Remove ftrace_preempt_disable/enable 2010-06-03 19:32:38 -04:00
trace_stat.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
trace_stat.h tracing/stat: Add stat_release() callback 2009-07-10 12:14:05 +02:00
trace_syscalls.c tracing: Use a global field list for all syscall exit events 2010-06-28 17:12:44 -04:00
trace_sysprof.c x86: Unify dumpstack.h and stacktrace.h 2010-06-08 23:29:52 +02:00
trace_workqueue.c tracing: Let tracepoints have data passed to tracepoint callbacks 2010-05-14 09:50:34 -04:00