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_io.c | |
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_io.c')
-rw-r--r-- | fs/bcachefs/journal_io.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index 26556bb381b2..cb2cfbbf50d4 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -1098,7 +1098,6 @@ static void journal_write_done(struct closure *cl) if (!w->noflush) { j->flushed_seq_ondisk = seq; j->last_seq_ondisk = last_seq; - bch2_journal_space_available(j); } /* @@ -1122,6 +1121,8 @@ static void journal_write_done(struct closure *cl) } while ((v = atomic64_cmpxchg(&j->reservations.counter, old.v, new.v)) != old.v); + bch2_journal_space_available(j); + closure_wake_up(&w->wait); journal_wake(j); |