summaryrefslogtreecommitdiff
path: root/libbcachefs/rebalance.c
diff options
context:
space:
mode:
authorAleksei Kharlamov <der@2-47.ru>2022-02-26 18:05:28 +0100
committerAleksei Kharlamov <der@2-47.ru>2022-02-26 21:31:11 +0100
commit63805882d4a60de63ed82d81ef4cfbb6e499753a (patch)
tree682f0c0b33175883f87c9c597a597a5a7644c358 /libbcachefs/rebalance.c
parent5528e3ae62ead1cfd5be36c1712d1a2dd5ccb3af (diff)
Update bcachefs sources to 31718a2: bcachefs: Don't spin in journal reclaim
Signed-off-by: Aleksei Kharlamov <aleksei@devass.club>
Diffstat (limited to 'libbcachefs/rebalance.c')
-rw-r--r--libbcachefs/rebalance.c42
1 files changed, 27 insertions, 15 deletions
diff --git a/libbcachefs/rebalance.c b/libbcachefs/rebalance.c
index a573fede..d914892f 100644
--- a/libbcachefs/rebalance.c
+++ b/libbcachefs/rebalance.c
@@ -257,35 +257,47 @@ void bch2_rebalance_work_to_text(struct printbuf *out, struct bch_fs *c)
{
struct bch_fs_rebalance *r = &c->rebalance;
struct rebalance_work w = rebalance_work(c);
- char h1[21], h2[21];
- bch2_hprint(&PBUF(h1), w.dev_most_full_work << 9);
- bch2_hprint(&PBUF(h2), w.dev_most_full_capacity << 9);
- pr_buf(out, "fullest_dev (%i):\t%s/%s\n",
- w.dev_most_full_idx, h1, h2);
+ out->tabstops[0] = 20;
- bch2_hprint(&PBUF(h1), w.total_work << 9);
- bch2_hprint(&PBUF(h2), c->capacity << 9);
- pr_buf(out, "total work:\t\t%s/%s\n", h1, h2);
+ pr_buf(out, "fullest_dev (%i):", w.dev_most_full_idx);
+ pr_tab(out);
- pr_buf(out, "rate:\t\t\t%u\n", r->pd.rate.rate);
+ bch2_hprint(out, w.dev_most_full_work << 9);
+ pr_buf(out, "/");
+ bch2_hprint(out, w.dev_most_full_capacity << 9);
+ pr_newline(out);
+
+ pr_buf(out, "total work:");
+ pr_tab(out);
+
+ bch2_hprint(out, w.total_work << 9);
+ pr_buf(out, "/");
+ bch2_hprint(out, c->capacity << 9);
+ pr_newline(out);
+
+ pr_buf(out, "rate:");
+ pr_tab(out);
+ pr_buf(out, "%u", r->pd.rate.rate);
+ pr_newline(out);
switch (r->state) {
case REBALANCE_WAITING:
- pr_buf(out, "waiting\n");
+ pr_buf(out, "waiting");
break;
case REBALANCE_THROTTLED:
- bch2_hprint(&PBUF(h1),
+ pr_buf(out, "throttled for %lu sec or ",
+ (r->throttled_until_cputime - jiffies) / HZ);
+ bch2_hprint(out,
(r->throttled_until_iotime -
atomic64_read(&c->io_clock[WRITE].now)) << 9);
- pr_buf(out, "throttled for %lu sec or %s io\n",
- (r->throttled_until_cputime - jiffies) / HZ,
- h1);
+ pr_buf(out, " io");
break;
case REBALANCE_RUNNING:
- pr_buf(out, "running\n");
+ pr_buf(out, "running");
break;
}
+ pr_newline(out);
}
void bch2_rebalance_stop(struct bch_fs *c)