lkml.org 
[lkml]   [2012]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available
From
On Sun, 23 Dec 2012, Sasha Levin wrote:
>> diff --git a/mm/bootmem.c b/mm/bootmem.c
>> index 1324cd7..198a92f 100644
>> --- a/mm/bootmem.c
>> +++ b/mm/bootmem.c
>> @@ -763,9 +763,6 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
>> void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
>> unsigned long align, unsigned long goal)
>> {
>> - if (WARN_ON_ONCE(slab_is_available()))
>> - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id);
>> -
>> return ___alloc_bootmem_node(pgdat, size, align, goal, 0);
>> }

On Fri, Dec 28, 2012 at 12:25 AM, David Rientjes <rientjes@google.com> wrote:
> All you're doing is removing the fallback if this happens to be called
> with slab_is_available(). It's still possible that the slab allocator can
> successfully allocate the memory, though. So it would be rather
> unfortunate to start panicking in a situation that used to only emit a
> warning.
>
> Why can't you panic only kzalloc_node() returns NULL and otherwise just
> return the allocated memory?

I'm not sure what Sasha's patch is trying to do here but the fall-back
is there simply to let the caller know it's calling the bootmem
allocator *too late*. That is, the slab allocator is already up and
running so you're expected to use that.

Pekka


\
 
 \ /
  Last update: 2012-12-28 00:01    [W:1.067 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site