• Andrew Morton's avatar
    [PATCH] ext3: concurrent block/inode allocation · c12b9866
    Andrew Morton authored
    From: Alex Tomas <bzzz@tmi.comex.ru>
    
    
    This patch weans ext3 off lock_super()-based protection for the inode and
    block allocators.
    
    It's basically the same as the ext2 changes.
    
    
    1) each group has own spinlock, which is used for group counter
       modifications
    
    2) sb->s_free_blocks_count isn't used any more.  ext2_statfs() and
       find_group_orlov() loop over groups to count free blocks
    
    3) sb->s_free_blocks_count is recalculated at mount/umount/sync_super time
       in order to check consistency and to avoid fsck warnings
    
    4) reserved blocks are distributed over last groups
    
    5) ext3_new_block() tries to use non-reserved blocks and if it fails then
       tries to use reserved blocks
    
    6) ext3_new_block() and ext3_free_blocks do not modify sb->s_free_blocks,
       therefore they do not call mark_buffer_dirty() for superblock's
       buffer_head. this should reduce I/O a bit
    
    
    Also fix orlov allocator boundary case:
    
    In the interests of SMP scalability the ext2 free blocks and free inodes
    counters are "approximate".  But there is a piece of code in the Orlov
    allocator which fails due to boundary conditions on really small
    filesystems.
    
    Fix that up via a final allocation pass which simply uses first-fit for
    allocatiopn of a directory inode.
    c12b9866
transaction.c 60.9 KB