1

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>
This commit is contained in:
Kent Overstreet 2022-06-19 23:03:07 -04:00 committed by Kent Overstreet
parent b5f73fd79f
commit 7bb61e8c0e
2 changed files with 7 additions and 4 deletions

View File

@ -22,8 +22,6 @@
#include <linux/ioprio.h> #include <linux/ioprio.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#define SECTORS_IN_FLIGHT_PER_DEVICE 2048
struct moving_io { struct moving_io {
struct list_head list; struct list_head list;
struct closure cl; struct closure cl;
@ -693,11 +691,11 @@ static int __bch2_move_data(struct bch_fs *c,
move_ctxt_wait_event(ctxt, &trans, move_ctxt_wait_event(ctxt, &trans,
atomic_read(&ctxt->write_sectors) < atomic_read(&ctxt->write_sectors) <
SECTORS_IN_FLIGHT_PER_DEVICE); c->opts.move_bytes_in_flight >> 9);
move_ctxt_wait_event(ctxt, &trans, move_ctxt_wait_event(ctxt, &trans,
atomic_read(&ctxt->read_sectors) < atomic_read(&ctxt->read_sectors) <
SECTORS_IN_FLIGHT_PER_DEVICE); c->opts.move_bytes_in_flight >> 9);
bch2_trans_begin(&trans); bch2_trans_begin(&trans);

View File

@ -290,6 +290,11 @@ enum opt_type {
OPT_UINT(0, U32_MAX), \ OPT_UINT(0, U32_MAX), \
BCH_SB_JOURNAL_RECLAIM_DELAY, 100, \ BCH_SB_JOURNAL_RECLAIM_DELAY, 100, \
NULL, "Delay in milliseconds before automatic journal reclaim")\ 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, \ x(fsck, u8, \
OPT_FS|OPT_MOUNT, \ OPT_FS|OPT_MOUNT, \
OPT_BOOL(), \ OPT_BOOL(), \