]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
tracing: Allocate mask_str buffer dynamically
authorChangbin Du <changbin.du@intel.com>
Thu, 30 Nov 2017 03:39:43 +0000 (11:39 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 13 Mar 2018 10:27:50 +0000 (11:27 +0100)
commit452bbbe5f26c69d8b1c51fc25e0c40ccf7fe8624
treef7b8b13f56cf75210e5470435ab193348e096127
parent3ac3d36caa84aef3da41905a38b647c483641984
tracing: Allocate mask_str buffer dynamically

BugLink: http://bugs.launchpad.net/bugs/1745052
commit 90e406f96f630c07d631a021fd4af10aac913e77 upstream.

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: 36dfe9252bd4c ("ftrace: make use of tracing_cpumask")
Signed-off-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/trace/trace.c