[lkml]   [2009]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH -stable] vmalloc: conditionalize build of pcpu_get_vm_areas()
    pcpu_get_vm_areas() is used only when dynamic percpu allocator is used
    by the architecture. In 2.6.32, ia64 doesn't use dynamic percpu
    allocator and has a macro which makes pcpu_get_vm_areas() buggy via
    local/global variable aliasing and triggers compile warning.

    The problem is fixed in upstream and ia64 uses dynamic percpu
    allocators, so the only left issue is inclusion of unnecessary code
    and compile warning on ia64 on 2.6.32.

    Don't build pcpu_get_vm_areas() if legacy percpu allocator is in use.

    Signed-off-by: Tejun Heo <>
    Reported-by: Jan Beulich <>
    Please note that this commit won't appear on upstream.


    include/linux/vmalloc.h | 2 ++
    mm/vmalloc.c | 2 ++
    2 files changed, 4 insertions(+)

    diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
    index 227c2a5..3c123c3 100644
    --- a/include/linux/vmalloc.h
    +++ b/include/linux/vmalloc.h
    @@ -115,9 +115,11 @@ extern rwlock_t vmlist_lock;
    extern struct vm_struct *vmlist;
    extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);

    struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
    const size_t *sizes, int nr_vms,
    size_t align, gfp_t gfp_mask);

    void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);

    diff --git a/mm/vmalloc.c b/mm/vmalloc.c
    index 0f551a4..7758726 100644
    --- a/mm/vmalloc.c
    +++ b/mm/vmalloc.c
    @@ -1993,6 +1993,7 @@ void free_vm_area(struct vm_struct *area)

    static struct vmap_area *node_to_va(struct rb_node *n)
    return n ? rb_entry(n, struct vmap_area, rb_node) : NULL;
    @@ -2257,6 +2258,7 @@ err_free:
    return NULL;

    * pcpu_free_vm_areas - free vmalloc areas for percpu allocator

     \ /
      Last update: 2009-12-10 00:45    [W:0.030 / U:7.996 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site