summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-06-19 23:03:07 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-01-06 00:05:49 -0500
commitce9fc766dc17767dcfde904081ea98fa403c332f (patch)
tree182f2e00376449792fe1c78f84dea2bed24815d5
parentc0dd40011683c141ba97d273905fa73754891b17 (diff)
bcachefs: Make IO in flight by copygc/rebalance configurable
This adds a new option, move_bytes_in_flight, for configuring the amount of IO in flight by copygc/rebalance - users with many devices in their filesystem will want to increase this. In the future we should be smarter about this, but this is an easy improvement. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/move.c6
-rw-r--r--fs/bcachefs/opts.h5
2 files changed, 7 insertions, 4 deletions
diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c
index 0cfe70cec6eb..778c21ba3298 100644
--- a/fs/bcachefs/move.c
+++ b/fs/bcachefs/move.c
@@ -23,8 +23,6 @@
#include <trace/events/bcachefs.h>
-#define SECTORS_IN_FLIGHT_PER_DEVICE 2048
-
struct moving_io {
struct list_head list;
struct closure cl;
@@ -281,11 +279,11 @@ static int move_ratelimit(struct btree_trans *trans,
move_ctxt_wait_event(ctxt, trans,
atomic_read(&ctxt->write_sectors) <
- SECTORS_IN_FLIGHT_PER_DEVICE);
+ c->opts.move_bytes_in_flight >> 9);
move_ctxt_wait_event(ctxt, trans,
atomic_read(&ctxt->read_sectors) <
- SECTORS_IN_FLIGHT_PER_DEVICE);
+ c->opts.move_bytes_in_flight >> 9);
return 0;
}
diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h
index 6a5584215607..97bffd462f3b 100644
--- a/fs/bcachefs/opts.h
+++ b/fs/bcachefs/opts.h
@@ -290,6 +290,11 @@ enum opt_type {
OPT_UINT(0, U32_MAX), \
BCH_SB_JOURNAL_RECLAIM_DELAY, 100, \
NULL, "Delay in milliseconds before automatic journal reclaim")\
+ x(move_bytes_in_flight, u32, \
+ OPT_HUMAN_READABLE|OPT_FS|OPT_MOUNT|OPT_RUNTIME, \
+ OPT_UINT(1024, U32_MAX), \
+ BCH2_NO_SB_OPT, 1U << 20, \
+ NULL, "Amount of IO in flight to keep in flight by the move path")\
x(fsck, u8, \
OPT_FS|OPT_MOUNT, \
OPT_BOOL(), \