diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-31 04:15:57 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-04-01 00:39:10 +0300 |
commit | f540876f4eea82295f3af72f786aae51b7378fb2 (patch) | |
tree | 865b651179cd521f301ee94d405bbb4fd2bb4ea2 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 650f5353dcc9b6e690a1c763754fa1e98d217bfc (diff) | |
download | linux-f540876f4eea82295f3af72f786aae51b7378fb2.tar.xz |
bcachefs: Fix striping behaviour
For striping across devices, we maintain "clocks", and we advance them
by the inverse of "how much free space this device has left", so that we
round robin biased in favor of devices with more free space.
This code was originally trying to do EWMA-ish stuff when originally
written, ~10 years ago, and was never properly cleaned up when it was
realized that an EWMA is not the right approach here.
That left a bug, when we rescale to keep all the clocks in the correct
range and prevent overflow.
It was assumed that we'd always be allocated from the device with the
smallest clock hand, but that's actually not correct: with the target
options, allocations will be first tried from a subset of devices, and
then the entire filesystem if that fails.
Thus, the rescale from the first allocation - allocating from a subset
of devices - can pick the wrong rescale value and cause the rest of the
clocks to go to 0, losing information.
This resuls in incorrect striping behaviour when the desired number of
replicas doesn't fit on the foreground target.
Link: https://www.reddit.com/r/bcachefs/comments/1jn3t26/replica_allocation_not_evenly_distributed_among/
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions