bcachefs: Redo copygc throttling
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 20 Dec 2019 21:19:46 +0000 (16:19 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:33 +0000 (17:08 -0400)
commit309c54c3f4151be97ff27b38e08de51a71ea0377
tree6c9d19dec922ab68d275bde00271deb749cc4920
parent5873efbfd9c3f53312aaa6c3024592a2a344f615
bcachefs: Redo copygc throttling

The code that checked the current free space and waited if it was too
big was causing issues - btree node allocations do not increment the
write IO clock (perhaps they should); but more broadly the check
wouldn't run copygc at all until the device was mostly full, at which
point it might have to do a bunch of work.

This redoes that logic so that copygc starts to run earlier, smoothly
running more and more often as the device becomes closer to full.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/movinggc.c