lkml.org 
[lkml]   [2012]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] pidmap: Use GFP_ATOMIC to allocate page (was: Re: [ 00/54] 3.0.32-stable review)
On Sat, May 19, 2012 at 7:32 PM, David Rientjes <rientjes@google.com> wrote:
>
> Why wasn't this caught by gfp_allowed_mask in slab_pre_alloc_hook()?
> GFP_KERNEL should be allowed in this context.

We set gfp_allowed_mask to allow all allocations before this point: it
happens when we enable interrupts fairly early during start_kernel().

So by the time pidmap_init() is called, GFP_KERNEL does imply that
scheduling can happen.

Which does imply that we set gfp_allowed_mask *much* too early. We
still cannot schedule at that point (well, at least there's a comment
saying so):

/*
* Disable preemption - early bootup scheduling is extremely
* fragile until we cpu_idle() for the first time.
*/
preempt_disable();

so logically we should move the gfp_allowed_mask setting down to where
we really are properly alive.

How about moving it down to after we've done the full smp_init() and
after we've actually done the first schedule and have proper idle
CPU's?

Something like the attached (UNTESTED!) patch?

Linus
[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2012-05-20 21:41    [W:0.095 / U:0.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site