diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2020-12-09 19:08:45 +0300 | 
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2020-12-09 19:08:45 +0300 | 
| commit | 2b3c99ee6389d33aff91d9e7a55465d7d1332bbd (patch) | |
| tree | 9e1e5d839d80c95854007c958f2c367290bf1090 /fs/jbd2/commit.c | |
| parent | 97d62caa32d6d79dadae3f8d19af5c92ea9a589a (diff) | |
| parent | 31784cff7ee073b34d6eddabb95e3be2880a425c (diff) | |
| download | linux-2b3c99ee6389d33aff91d9e7a55465d7d1332bbd.tar.xz | |
Merge branch 'locking/rwsem'
Diffstat (limited to 'fs/jbd2/commit.c')
| -rw-r--r-- | fs/jbd2/commit.c | 11 | 
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index fa688e163a80..b121d7d434c6 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -450,6 +450,15 @@ void jbd2_journal_commit_transaction(journal_t *journal)  		schedule();  		write_lock(&journal->j_state_lock);  		finish_wait(&journal->j_fc_wait, &wait); +		/* +		 * TODO: by blocking fast commits here, we are increasing +		 * fsync() latency slightly. Strictly speaking, we don't need +		 * to block fast commits until the transaction enters T_FLUSH +		 * state. So an optimization is possible where we block new fast +		 * commits here and wait for existing ones to complete +		 * just before we enter T_FLUSH. That way, the existing fast +		 * commits and this full commit can proceed parallely. +		 */  	}  	write_unlock(&journal->j_state_lock); @@ -801,7 +810,7 @@ start_journal_io:  		if (first_block < journal->j_tail)  			freed += journal->j_last - journal->j_first;  		/* Update tail only if we free significant amount of space */ -		if (freed < journal->j_maxlen / 4) +		if (freed < jbd2_journal_get_max_txn_bufs(journal))  			update_tail = 0;  	}  	J_ASSERT(commit_transaction->t_state == T_COMMIT);  | 
