lkml.org 
[lkml]   [2017]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2017-10-26 13:16    [W:0.048 / U:2.704 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site