Revert "vmalloc: remove BUG_ON due to racy counting of VM_LAZY_FREE"
author黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:26:39 +0000 (22:26 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:26:39 +0000 (22:26 +0800)
This reverts commit 21ba0cac4b63286aaf41befb3b93c8ffb5036306.

mm/vmalloc.c

index c85d75406c8168bd92043f237669d6abd1c00e02..0f551a4a44cddc7a042d47bbcd85c7126569ee69 100644 (file)
@@ -555,8 +555,10 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
        }
        rcu_read_unlock();
 
-       if (nr)
+       if (nr) {
+               BUG_ON(nr > atomic_read(&vmap_lazy_nr));
                atomic_sub(nr, &vmap_lazy_nr);
+       }
 
        if (nr || force_flush)
                flush_tlb_kernel_range(*start, *end);