lkml.org 
[lkml]   [2015]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] Add __GFP_ZERO to alloc_cpumask_var_node() if ptr is zero

* Steven Rostedt <rostedt@goodmis.org> wrote:

> On Fri, 04 Dec 2015 12:05:12 +1030
> Rusty Russell <rusty@rustcorp.com.au> wrote:
>
> > This is clever, but I would advise against such subtle code. We will never be
> > able to remove this code once it is in.
> >
> > Would suggest making the non-CPUMASK_OFFSTACK stubs write garbage into the
> > cpumasks instead, iff !(flags & __GFP_ZERO).
>
> I actually thought of the same thing, but thought it was a bit harsh. If others
> think that's a better solution, then I'll submit a patch to do that.

That just makes things more fragile - 'garbage' will spread the breakage, and if
the breakage is subtle, it will spread subtle breakage.

So why not use a kzmalloc_node() [equivalent] call instead of kmalloc_node(), to
make sure it's all zeroed instead of uninitialized?

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-12-04 09:01    [W:0.129 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site