lkml.org 
[lkml]   [2008]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] seq_file: Add seq_cpumask_list(), seq_nodemask_list()
Andrew Morton wrote:
> On Sun, 12 Oct 2008 17:29:25 +0800
> Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
>
>> +static inline int seq_cpumask_list(struct seq_file *m, cpumask_t *mask)
>> +{
>> + return seq_bitmap_list(m, mask->bits, NR_CPUS);
>> +}
>
> Is it possible to avoid using NR_CPUS? In some situations it'd be much
> more efficient to use the runtime-determined max possible cpu index.
>
> But I don't immediately recall how to get at that number.
> num_possible_cpus() assumes that there are no holes in the CPU
> identifier list.
>

nr_cpu_ids represents the max index +1 of the possible cpus. (Usually the
same as num_possible_cpus() except a.) it doesn't need to do the cpus_weight()
op, and b.) *if* (a big if) the cpu indices are sparse, then they wouldn't
be the same values.)

Thanks,
Mike


\
 
 \ /
  Last update: 2008-10-17 00:59    [W:0.038 / U:1.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site