Index: linux-2.6/mm/vmalloc.c =================================================================== --- linux-2.6.orig/mm/vmalloc.c +++ linux-2.6/mm/vmalloc.c @@ -531,6 +531,17 @@ static void purge_vmap_area_lazy(void) __purge_vmap_area_lazy(&start, &end, 0, 0); } +static void deferred_purge(struct work_struct *work) +{ + purge_vmap_area_lazy(); +} + +static struct work_struct purge_work; +static void kick_purge_vmap_area_lazy(void) +{ + schedule_work(&purge_work); +} + /* * Free and unmap a vmap area */ @@ -539,7 +550,7 @@ static void free_unmap_vmap_area(struct va->flags |= VM_LAZY_FREE; atomic_add((va->va_end - va->va_start) >> PAGE_SHIFT, &vmap_lazy_nr); if (unlikely(atomic_read(&vmap_lazy_nr) > lazy_max_pages())) - purge_vmap_area_lazy(); + kick_purge_vmap_area_lazy(); } static struct vmap_area *find_vmap_area(unsigned long addr) @@ -938,6 +949,7 @@ void __init vmalloc_init(void) { int i; + INIT_WORK(&purge_work, deferred_purge); for_each_possible_cpu(i) { struct vmap_block_queue *vbq;