• Roman Pen's avatar
    mm/vmalloc: occupy newly allocated vmap block just after allocation · cf725ce2
    Roman Pen authored
    Previous implementation allocates new vmap block and repeats search of a
    free block from the very beginning, iterating over the CPU free list.
    
    Why it can be better??
    
    1. Allocation can happen on one CPU, but search can be done on another CPU.
       In worst case we preallocate amount of vmap blocks which is equal to
       CPU number on the system.
    
    2. In previous patch I added newly allocated block to the tail of free list
       to avoid soon exhaustion of virtual space and give a chance to occupy
       blocks which were allocated long time ago.  Thus to find newly allocated
       block all the search sequence should be repeated, seems it is not efficient.
    
    In this patch newly allocated block is occupied right away, address of
    virtual space is returned to the caller, so there is no any need to repeat
    the search sequence, allocation job is done.
    Signed-off-by: default avatarRoman Pen <r.peniaev@gmail.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Eric Dumazet <edumazet@google.com>
    Acked-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: WANG Chao <chaowang@redhat.com>
    Cc: Fabian Frederick <fabf@skynet.be>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Gioh Kim <gioh.kim@lge.com>
    Cc: Rob Jones <rob.jones@codethink.co.uk>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    cf725ce2
vmalloc.c 69.1 KB