• Nick Piggin's avatar
    [PATCH] mempool: NOMEMALLOC and NORETRY · b84a35be
    Nick Piggin authored
    Mempools have 2 problems.
    
    The first is that mempool_alloc can possibly get stuck in __alloc_pages
    when they should opt to fail, and take an element from their reserved pool.
    
    The second is that it will happily eat emergency PF_MEMALLOC reserves
    instead of going to their reserved pools.
    
    Fix the first by passing __GFP_NORETRY in the allocation calls in
    mempool_alloc.  Fix the second by introducing a __GFP_MEMPOOL flag which
    directs the page allocator not to allocate from the reserve pool.
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    b84a35be
mempool.c 8.02 KB