bcachefs: Introduce a separate journal watermark for copygc
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 15 Mar 2022 01:48:42 +0000 (21:48 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:29 +0000 (17:09 -0400)
commit31f63fd1244d9609265eb5cfc522c142b35cdacc
treeba7e780ac34fe7ce6f6647b0a47f4da301b26d83
parentd905f67ec89fda758bcfa70d0b5c3d3006bbdb3e
bcachefs: Introduce a separate journal watermark for copygc

Since journal reclaim -> btree key cache flushing may require the
allocation of new btree nodes, it has an implicit dependency on copygc
in order to make forward progress - so we should avoid blocking copygc
unless the journal is really close to full.

This introduces watermarks to replace our single MAY_GET_UNRESERVED bit
in the journal, and adds a watermark for copygc and plumbs it through.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c
fs/bcachefs/btree_key_cache.c
fs/bcachefs/btree_update.h
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/journal.c
fs/bcachefs/journal.h
fs/bcachefs/journal_reclaim.c
fs/bcachefs/journal_types.h
fs/bcachefs/movinggc.c
fs/bcachefs/recovery.c