Re: [RFC][PATCH] Add __GFP_ZERO to alloc_cpumask_var_node() if ptr is zero

2015-12-07 Thread Ingo Molnar
* Rusty Russell wrote: > Ingo Molnar writes: > > * Rusty Russell wrote: > >> I don't think there are great answers here. But adding more subtle > >> zeroing > >> semantics feels wrong, even if it will mostly Just Work. > > > > It's not subtle if the naming clearly reflects it (hence my sugg

Re: [RFC][PATCH] Add __GFP_ZERO to alloc_cpumask_var_node() if ptr is zero

2015-12-06 Thread Rusty Russell
Ingo Molnar writes: > * Rusty Russell wrote: >> I don't think there are great answers here. But adding more subtle zeroing >> semantics feels wrong, even if it will mostly Just Work. > > It's not subtle if the naming clearly reflects it (hence my suggestion to > rename > the API) - and the st

Re: [RFC][PATCH] Add __GFP_ZERO to alloc_cpumask_var_node() if ptr is zero

2015-12-06 Thread Ingo Molnar
* Rusty Russell wrote: > Ingo Molnar writes: > > * Steven Rostedt wrote: > > > >> On Fri, 04 Dec 2015 12:05:12 +1030 > >> Rusty Russell 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. >

Re: [RFC][PATCH] Add __GFP_ZERO to alloc_cpumask_var_node() if ptr is zero

2015-12-05 Thread Rusty Russell
Ingo Molnar writes: > * Steven Rostedt wrote: > >> On Fri, 04 Dec 2015 12:05:12 +1030 >> Rusty Russell 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-CPUMAS

Re: [RFC][PATCH] Add __GFP_ZERO to alloc_cpumask_var_node() if ptr is zero

2015-12-03 Thread Ingo Molnar
* Steven Rostedt wrote: > On Fri, 04 Dec 2015 12:05:12 +1030 > Rusty Russell 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

Re: [RFC][PATCH] Add __GFP_ZERO to alloc_cpumask_var_node() if ptr is zero

2015-12-03 Thread Steven Rostedt
On Fri, 04 Dec 2015 12:05:12 +1030 Rusty Russell 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 & __GF

Re: [RFC][PATCH] Add __GFP_ZERO to alloc_cpumask_var_node() if ptr is zero

2015-12-03 Thread Rusty Russell
Steven Rostedt writes: > Xunlei Pang reported a bug in the scheduler code when > CONFIG_CPUMASK_OFFSTACK is set, several of the cpumasks used by the > root domains can contain garbage. The code does the following: > > memset(rd, 0, sizeof(*rd)); > > if (!alloc_cpumask_var(&rd->span

[RFC][PATCH] Add __GFP_ZERO to alloc_cpumask_var_node() if ptr is zero

2015-12-03 Thread Steven Rostedt
Xunlei Pang reported a bug in the scheduler code when CONFIG_CPUMASK_OFFSTACK is set, several of the cpumasks used by the root domains can contain garbage. The code does the following: memset(rd, 0, sizeof(*rd)); if (!alloc_cpumask_var(&rd->span, GFP_KERNEL)) goto