lkml.org 
[lkml]   [2008]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] x86: Add check for node passed to node_to_cpumask V3
Vegard Nossum wrote:
> On Fri, Jun 27, 2008 at 8:03 PM, Mike Travis <travis@sgi.com> wrote:
>>> So if CONFIG_DEBUG_RODATA=y, I believe we'll see first this warning,
>>> then a panic (after all). Would it be better to make cpu_mask_none
>>> non-const, in spirit of trying to continue as far as possible? I don't
>>> really know if it matters, though. It seems that fedora kernels at
>>> least ship with a default of DEBUG_RODATA=y.
>>>
>
> ...
>
>> Ingo asked me to add the "const". But it would be a mistake to use
>> node_to_cpumask_ptr to modify the map... numa_set/clear_node is the
>> proper way to modify the maps. Hmm, maybe I should add "const" to
>> the real node_to_cpumask_ptr function, at least then the compiler
>> would help spot illegal usages.
>
> That sounds like a brilliant idea, as long as none of the callers
> expect it to be non-const.

Being that I modified all the callers to use this new function, I did
verify that each caller expected it to be read only... ;-)
>
> I changed it to return const to see, and built allmodconfig + a few
> randconfigs without error (well, warning). There are not that many
> users of this function anyway.

Did any violate the read-only nature of the call?
>
> BTW, what's up with the topology.h/setup_percpu.c mismatch, when
> topology.c exists as well?

Topology.h supplies the generic usage which is to define a local cpumask
variable, fill it, and then return a pointer to it. This is for arch's
that do not maintain a separate node_to_cpumask_map[] but allows a
compatible call interface.
>
>
> Vegard
>

Thanks!
Mike



\
 
 \ /
  Last update: 2008-06-29 14:43    [W:1.229 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site