Skip to contentSkip to conversation

jbd2: Increase maximum transaction size

PATCH Applied Jan Kara 3 participants 3 messages Jul 1, 2024 – Jul 11, 2024 Journalling layer for block devices (JBD2)

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 jbd2: Increase maximum transaction size

Originally, we were quite conservative in limiting maximum transaction size to a quarter of the journal because we were not accounting transaction descriptor and revoke blocks. These days we do properly account them and reserve space for them from the total transaction credits. Thus there's no need to be so conservative and we can increase the maximum transaction size to one third of the journal (even half should work fine in principle but the performance will likely suffer in that case). This also fixes failures to grow filesystems with tiny journals.

Link CA+hUFcuGs04JHZ_WzA1zGN57+ehL2qmHOt5a7RMpo+rv6Vyxtw@mail.gmail.com
---
 include/linux/jbd2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/jbd2.h +1 -1
index ab04c1c27fae..7273ef1732bf 100644
@@ -1662,7 +1662,7 @@ int jbd2_fc_release_bufs(journal_t *journal);
 
 static inline int jbd2_journal_get_max_txn_bufs(journal_t *journal)
 {
-	return (journal->j_total_len - journal->j_fc_wbufsize) / 4;
+	return (journal->j_total_len - journal->j_fc_wbufsize) / 3;
 }
 
 /*
Signature · 1 line
2.35.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jan Kara

Originally, we were quite conservative in limiting maximum transaction size to a quarter of the journal because we were not accounting transaction descriptor and revoke blocks. These days we do properly account them and reserve space for them from the total transaction credits. Thus there's no need to be so conservative and we can increase the maximum transaction size to one third of the journal (even half should work fine in principle but the performance will likely suffer in that case). This also fixes failures to grow filesystems with tiny journals.

This looks straightforward and reasonable to me. I've done some metadata intensive performance tests with fs_mark, no obvious degradation and fluctuation has been found.

Thanks,
Yi.

Quoted 20 lines
Link CA+hUFcuGs04JHZ_WzA1zGN57+ehL2qmHOt5a7RMpo+rv6Vyxtw@mail.gmail.com
---
 include/linux/jbd2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/jbd2.h +1 -1
index ab04c1c27fae..7273ef1732bf 100644
@@ -1662,7 +1662,7 @@ int jbd2_fc_release_bufs(journal_t *journal);
 
 static inline int jbd2_journal_get_max_txn_bufs(journal_t *journal)
 {
-	return (journal->j_total_len - journal->j_fc_wbufsize) / 4;
+	return (journal->j_total_len - journal->j_fc_wbufsize) / 3;
 }
 
 /*
maintainer Applied
#2 lore raw
In reply to Jan Kara
Quoted 11 lines · Jan Kara

Originally, we were quite conservative in limiting maximum transaction size to a quarter of the journal because we were not accounting transaction descriptor and revoke blocks. These days we do properly account them and reserve space for them from the total transaction credits. Thus there's no need to be so conservative and we can increase the maximum transaction size to one third of the journal (even half should work fine in principle but the performance will likely suffer in that case). This also fixes failures to grow filesystems with tiny journals.

[...]

Applied, thanks!

[1/1] jbd2: Increase maximum transaction size

      commit: a794c9ad026f0a28044347f31929fcdb0270eadc

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>