mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]>
This commit is contained in:
parent
f4a8116a4c
commit
7b9ca4c61b
6 changed files with 186 additions and 132 deletions
|
|
@ -5194,7 +5194,7 @@ static int ext4_statfs_project(struct super_block *sb,
|
|||
dquot = dqget(sb, qid);
|
||||
if (IS_ERR(dquot))
|
||||
return PTR_ERR(dquot);
|
||||
spin_lock(&dq_data_lock);
|
||||
spin_lock(&dquot->dq_dqb_lock);
|
||||
|
||||
limit = (dquot->dq_dqb.dqb_bsoftlimit ?
|
||||
dquot->dq_dqb.dqb_bsoftlimit :
|
||||
|
|
@ -5217,7 +5217,7 @@ static int ext4_statfs_project(struct super_block *sb,
|
|||
(buf->f_files - dquot->dq_dqb.dqb_curinodes) : 0;
|
||||
}
|
||||
|
||||
spin_unlock(&dq_data_lock);
|
||||
spin_unlock(&dquot->dq_dqb_lock);
|
||||
dqput(dquot);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue