Skip to content
Commit 90e406f9 authored by Changbin Du's avatar Changbin Du Committed by Steven Rostedt (VMware)
Browse files

tracing: Allocate mask_str buffer dynamically

The default NR_CPUS can be very large, but actual possible nr_cpu_ids
usually is very small. For my x86 distribution, the NR_CPUS is 8192 and
nr_cpu_ids is 4. About 2 pages are wasted.

Most machines don't have so many CPUs, so define a array with NR_CPUS
just wastes memory. So let's allocate the buffer dynamically when need.

With this change, the mutext tracing_cpumask_update_lock also can be
removed now, which was used to protect mask_str.

Link: http://lkml.kernel.org/r/1512013183-19107-1-git-send-email-changbin.du@intel.com

Fixes: 36dfe925

 ("ftrace: make use of tracing_cpumask")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarChangbin Du <changbin.du@intel.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 250d0c77
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment