Commit d086817dc0d42f1be8db4138233d33e1dd16a956

Authored by MinChan Kim
Committed by Linus Torvalds
1 parent ef161a9863

vmap: remove needless lock and list in vmap

vmap's dirty_list is unused.  It's for optimizing flushing.  but Nick
didn't write the code yet.  so, we don't need it until time as it is
needed.

This patch removes vmap_block's dirty_list and codes related to it.

Signed-off-by: MinChan Kim <minchan.kim@gmail.com>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 3 additions and 16 deletions Side-by-side Diff

... ... @@ -671,10 +671,7 @@
671 671 DECLARE_BITMAP(alloc_map, VMAP_BBMAP_BITS);
672 672 DECLARE_BITMAP(dirty_map, VMAP_BBMAP_BITS);
673 673 union {
674   - struct {
675   - struct list_head free_list;
676   - struct list_head dirty_list;
677   - };
  674 + struct list_head free_list;
678 675 struct rcu_head rcu_head;
679 676 };
680 677 };
... ... @@ -741,7 +738,6 @@
741 738 bitmap_zero(vb->alloc_map, VMAP_BBMAP_BITS);
742 739 bitmap_zero(vb->dirty_map, VMAP_BBMAP_BITS);
743 740 INIT_LIST_HEAD(&vb->free_list);
744   - INIT_LIST_HEAD(&vb->dirty_list);
745 741  
746 742 vb_idx = addr_to_vb_idx(va->va_start);
747 743 spin_lock(&vmap_block_tree_lock);
... ... @@ -772,12 +768,7 @@
772 768 struct vmap_block *tmp;
773 769 unsigned long vb_idx;
774 770  
775   - spin_lock(&vb->vbq->lock);
776   - if (!list_empty(&vb->free_list))
777   - list_del(&vb->free_list);
778   - if (!list_empty(&vb->dirty_list))
779   - list_del(&vb->dirty_list);
780   - spin_unlock(&vb->vbq->lock);
  771 + BUG_ON(!list_empty(&vb->free_list));
781 772  
782 773 vb_idx = addr_to_vb_idx(vb->va->va_start);
783 774 spin_lock(&vmap_block_tree_lock);
... ... @@ -862,11 +853,7 @@
862 853  
863 854 spin_lock(&vb->lock);
864 855 bitmap_allocate_region(vb->dirty_map, offset >> PAGE_SHIFT, order);
865   - if (!vb->dirty) {
866   - spin_lock(&vb->vbq->lock);
867   - list_add(&vb->dirty_list, &vb->vbq->dirty);
868   - spin_unlock(&vb->vbq->lock);
869   - }
  856 +
870 857 vb->dirty += 1UL << order;
871 858 if (vb->dirty == VMAP_BBMAP_BITS) {
872 859 BUG_ON(vb->free || !list_empty(&vb->free_list));