jbd2: Change j_state_lock to be a rwlock_t
Lockstat reports have shown that j_state_lock is a major source of lock contention, especially on systems with more than 4 CPU cores. So change it to be a read/write spinlock. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
@ -3232,7 +3232,7 @@ static void ext4_init_journal_params(struct super_block *sb, journal_t *journal)
|
||||
journal->j_min_batch_time = sbi->s_min_batch_time;
|
||||
journal->j_max_batch_time = sbi->s_max_batch_time;
|
||||
|
||||
spin_lock(&journal->j_state_lock);
|
||||
write_lock(&journal->j_state_lock);
|
||||
if (test_opt(sb, BARRIER))
|
||||
journal->j_flags |= JBD2_BARRIER;
|
||||
else
|
||||
@ -3241,7 +3241,7 @@ static void ext4_init_journal_params(struct super_block *sb, journal_t *journal)
|
||||
journal->j_flags |= JBD2_ABORT_ON_SYNCDATA_ERR;
|
||||
else
|
||||
journal->j_flags &= ~JBD2_ABORT_ON_SYNCDATA_ERR;
|
||||
spin_unlock(&journal->j_state_lock);
|
||||
write_unlock(&journal->j_state_lock);
|
||||
}
|
||||
|
||||
static journal_t *ext4_get_journal(struct super_block *sb,
|
||||
|
Reference in New Issue
Block a user