quota: Reduce contention on dq_data_lock
dq_data_lock is currently used to protect all modifications of quota
accounting information, consistency of quota accounting on the inode,
and dquot pointers from inode. As a result contention on the lock can be
pretty heavy.
Reduce the contention on the lock by protecting quota accounting
information by a new dquot->dq_dqb_lock and consistency of quota
accounting with inode usage by inode->i_lock.
This change reduces time to create 500000 files on ext4 on ramdisk by 50
different processes in separate directories by 6% when user quota is
turned on. When those 50 processes belong to 50 different users, the
improvement is about 9%.
Signed-off-by:
Jan Kara <jack@suse.cz>
Showing
- fs/ext4/super.c 2 additions, 2 deletionsfs/ext4/super.c
- fs/ocfs2/quota_global.c 4 additions, 4 deletionsfs/ocfs2/quota_global.c
- fs/ocfs2/quota_local.c 4 additions, 4 deletionsfs/ocfs2/quota_local.c
- fs/quota/dquot.c 170 additions, 117 deletionsfs/quota/dquot.c
- fs/quota/quota_tree.c 4 additions, 4 deletionsfs/quota/quota_tree.c
- include/linux/quota.h 2 additions, 1 deletioninclude/linux/quota.h
Loading
Please register or sign in to comment