Commit 9ae28f82 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 2ee47eec
...@@ -1044,7 +1044,7 @@ int bch2_fs_journal_start(struct journal *j, u64 cur_seq, ...@@ -1044,7 +1044,7 @@ int bch2_fs_journal_start(struct journal *j, u64 cur_seq,
bch2_journal_space_available(j); bch2_journal_space_available(j);
spin_unlock(&j->lock); spin_unlock(&j->lock);
return 0; return bch2_journal_reclaim_start(j);
} }
/* init/exit: */ /* init/exit: */
......
...@@ -276,7 +276,7 @@ static void bch2_writes_disabled(struct percpu_ref *writes) ...@@ -276,7 +276,7 @@ static void bch2_writes_disabled(struct percpu_ref *writes)
void bch2_fs_read_only(struct bch_fs *c) void bch2_fs_read_only(struct bch_fs *c)
{ {
if (!test_bit(BCH_FS_RW, &c->flags)) { if (!test_bit(BCH_FS_RW, &c->flags)) {
BUG_ON(c->journal.reclaim_thread); bch2_journal_reclaim_stop(&c->journal);
return; return;
} }
...@@ -431,12 +431,6 @@ static int __bch2_fs_read_write(struct bch_fs *c, bool early) ...@@ -431,12 +431,6 @@ static int __bch2_fs_read_write(struct bch_fs *c, bool early)
for_each_rw_member(ca, c, i) for_each_rw_member(ca, c, i)
bch2_wake_allocator(ca); 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) { if (!early) {
ret = bch2_fs_read_write_late(c); ret = bch2_fs_read_write_late(c);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment