• Tejun Heo's avatar
    percpu: implement [__]alloc_percpu_gfp() · 5835d96e
    Tejun Heo authored
    Now that pcpu_alloc_area() can allocate only from populated areas,
    it's easy to add atomic allocation support to [__]alloc_percpu().
    Update pcpu_alloc() so that it accepts @gfp and skips all the blocking
    operations and allocates only from the populated areas if @gfp doesn't
    contain GFP_KERNEL.  New interface functions [__]alloc_percpu_gfp()
    are added.
    
    While this means that atomic allocations are possible, this isn't
    complete yet as there's no mechanism to ensure that certain amount of
    populated areas is kept available and atomic allocations may keep
    failing under certain conditions.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    5835d96e
percpu.c 58.9 KB