[Devel] Re: [PATCH 3/3] Quick vmalloc vs kmalloc fix to the case where array size is too large

Benjamin Blum bblum at google.com
Tue Jul 14 14:30:28 PDT 2009


Indeed.

Alternatively, I could make it case on KMALLOC_MAX_SIZE as follows:

if (size > KMALLOC_MAX_SIZE) {
    /* use vmalloc directly */
} else {
    /* try kmalloc, and, expecting fragmentation, if that fails, use vmalloc */
}

As the free wrapper uses is_vmalloc_addr, it'd work fine and be able
to decide for a certain range of sizes whether kmalloc or vmalloc is
appropriate.

On Tue, Jul 14, 2009 at 10:50 AM, Paul Menage<menage at google.com> wrote:
> On Tue, Jul 14, 2009 at 10:47 AM, Dave Hansen<dave at linux.vnet.ibm.com> wrote:
>>
>> How big were those allocations that were failing?  The code made it
>> appear that order-2 (PAGE_SIZE*4) allocations were failing.  That's a
>> bit lower than I'd expect the page allocator to start failing.
>
> I think it depends on how much fragmentation you've got.
>
> We've seen it fail for cpusets with (I guess) hundreds or thousands of threads.
>
> Paul
>
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list