[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171026071551.07b1228a@vmware.local.home>
Date: Thu, 26 Oct 2017 07:15:51 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: changbin.du@...el.com
Cc: mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] tracing: Allocate mask_str buffer dynamically
On Thu, 26 Oct 2017 00:20:28 +0800
changbin.du@...el.com wrote:
> From: Changbin Du <changbin.du@...el.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@...el.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
Powered by blists - more mailing lists