bcachefs: Persist 64 bit io clocks
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 21 Jan 2021 20:28:59 +0000 (15:28 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:52 +0000 (17:08 -0400)
commit2abe542087d9cb1bc7bb8ac7ae262afccbdb7aa6
treec33f5733a5cf3f091e59e5084be29ef5819a9f71
parent7f4e1d5d0faff0d72e9f6708bf98488d76533846
bcachefs: Persist 64 bit io clocks

Originally, bcachefs - going back to bcache - stored, for each bucket, a
16 bit counter corresponding to how long it had been since the bucket
was read from. But, this required periodically rescaling counters on
every bucket to avoid wraparound. That wasn't an issue in bcache, where
we'd perodically rewrite the per bucket metadata all at once, but in
bcachefs we're trying to avoid having to walk every single bucket.

This patch switches to persisting 64 bit io clocks, corresponding to the
64 bit bucket timestaps introduced in the previous patch with
KEY_TYPE_alloc_v2.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
19 files changed:
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_types.h
fs/bcachefs/bcachefs.h
fs/bcachefs/bcachefs_format.h
fs/bcachefs/btree_gc.c
fs/bcachefs/buckets.h
fs/bcachefs/buckets_types.h
fs/bcachefs/clock.c
fs/bcachefs/clock_types.h
fs/bcachefs/journal.c
fs/bcachefs/journal_io.c
fs/bcachefs/movinggc.c
fs/bcachefs/rebalance.c
fs/bcachefs/rebalance_types.h
fs/bcachefs/recovery.c
fs/bcachefs/super-io.c
fs/bcachefs/super-io.h
fs/bcachefs/super.c
fs/bcachefs/sysfs.c