summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-06-21 16:30:52 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-07-06 13:03:51 -0400
commit11d5b7ecd7a3c53cb9b713f95c7967e56f90e707 (patch)
tree47ba48abf7073115a1b9c6cb2f2516a0659fa115
parent1505932939d08c9c3818ce6571c03b7cc78e7fc6 (diff)
bcachefs: Start journal reclaim thread earlier
Especially in userspace, we sometime run into resource exhaustion issues with starting up threads after mark and sweep/fsck. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/journal.c2
-rw-r--r--fs/bcachefs/super.c8
2 files changed, 2 insertions, 8 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index d714779a28d0..ac4071fc4e80 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -1071,7 +1071,7 @@ int bch2_fs_journal_start(struct journal *j, u64 cur_seq,
bch2_journal_space_available(j);
spin_unlock(&j->lock);
- return 0;
+ return bch2_journal_reclaim_start(j);
}
/* init/exit: */
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index 2a570eb0763e..13a5ca713e7a 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -269,7 +269,7 @@ static void bch2_writes_disabled(struct percpu_ref *writes)
void bch2_fs_read_only(struct bch_fs *c)
{
if (!test_bit(BCH_FS_RW, &c->flags)) {
- BUG_ON(c->journal.reclaim_thread);
+ bch2_journal_reclaim_stop(&c->journal);
return;
}
@@ -431,12 +431,6 @@ static int __bch2_fs_read_write(struct bch_fs *c, bool early)
for_each_rw_member(ca, c, i)
bch2_wake_allocator(ca);
- ret = bch2_journal_reclaim_start(&c->journal);
- if (ret) {
- bch_err(c, "error starting journal reclaim: %i", ret);
- return ret;
- }
-
if (!early) {
ret = bch2_fs_read_write_late(c);
if (ret)