Messages in this thread | | | Date | Thu, 26 Oct 2017 07:15:51 -0400 | From | Steven Rostedt <> | Subject | Re: [PATCH v2] tracing: Allocate mask_str buffer dynamically |
| |
On Thu, 26 Oct 2017 00:20:28 +0800 changbin.du@intel.com wrote:
> From: Changbin Du <changbin.du@intel.com> > > 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. > > The exact buffer size should be: > DIV_ROUND_UP(nr_cpu_ids, 4) + nr_cpu_ids/32 + 2; > > Example output: > ff,ffffffff > > Signed-off-by: Changbin Du <changbin.du@intel.com> >
Thanks for sending this. I'm currently traveling for conferences, and may miss looking at this when I get back. Please send me a friendly ping reply to this email next week, if you don't hear from me sooner.
-- Steve
| |