diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-05 16:25:05 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:49 -0400 |
commit | 5d32c5bb076e76232e56fd44c537046abd54d32c (patch) | |
tree | a5df7839b857d7510fc23db234dea7a854d21177 /fs/bcachefs/journal.h | |
parent | adbcada43fa79197224b5a522b1faaf222b43bcd (diff) | |
download | lwn-5d32c5bb076e76232e56fd44c537046abd54d32c.tar.gz lwn-5d32c5bb076e76232e56fd44c537046abd54d32c.zip |
bcachefs: Be more conservation about journal pre-reservations
- Try to always keep 1/8th of the journal free, on top of
pre-reservations
- Move the check for whether the journal is stuck to
bch2_journal_space_available, and make it only fire when there aren't
any journal writes in flight (that might free up space by updating
last_seq)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.h')
-rw-r--r-- | fs/bcachefs/journal.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h index 2c0014c3c02f..df353a18011b 100644 --- a/fs/bcachefs/journal.h +++ b/fs/bcachefs/journal.h @@ -386,7 +386,7 @@ out: static inline bool journal_check_may_get_unreserved(struct journal *j) { union journal_preres_state s = READ_ONCE(j->prereserved); - bool ret = s.reserved <= s.remaining && + bool ret = s.reserved < s.remaining && fifo_free(&j->pin) > 8; lockdep_assert_held(&j->lock); @@ -510,6 +510,7 @@ static inline void bch2_journal_set_replay_done(struct journal *j) void bch2_journal_unblock(struct journal *); void bch2_journal_block(struct journal *); +void __bch2_journal_debug_to_text(struct printbuf *, struct journal *); void bch2_journal_debug_to_text(struct printbuf *, struct journal *); void bch2_journal_pins_to_text(struct printbuf *, struct journal *); |