diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-01 14:21:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-04 13:47:54 -0400 |
commit | d5e73ca148dc8ceb9c2125f4817674a2f5c7df60 (patch) | |
tree | e0e788aa40f9bd0771a3a00a204a673ff7192005 /fs/bcachefs/util.c | |
parent | fc837b568a5dea0215ea5c5ce271eb3c1c70b956 (diff) |
bcachefs: Don't promote when target is congestedbcachefs-v4.15
Diffstat (limited to 'fs/bcachefs/util.c')
-rw-r--r-- | fs/bcachefs/util.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 33e2d1fa795d..2e89a9755930 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -233,8 +233,8 @@ void bch2_quantiles_update(struct quantiles *q, u64 v) /* time stats: */ -static void __bch2_time_stats_update(struct time_stats *stats, - u64 start, u64 end) +static void bch2_time_stats_update_one(struct time_stats *stats, + u64 start, u64 end) { u64 duration, freq; @@ -260,14 +260,13 @@ static void __bch2_time_stats_update(struct time_stats *stats, bch2_quantiles_update(&stats->quantiles, duration); } -void bch2_time_stats_update(struct time_stats *stats, u64 start) +void __bch2_time_stats_update(struct time_stats *stats, u64 start, u64 end) { - u64 end = local_clock(); unsigned long flags; if (!stats->buffer) { spin_lock_irqsave(&stats->lock, flags); - __bch2_time_stats_update(stats, start, end); + bch2_time_stats_update_one(stats, start, end); if (stats->average_frequency < 32 && stats->count > 1024) @@ -285,7 +284,7 @@ void bch2_time_stats_update(struct time_stats *stats, u64 start) BUG_ON(b->nr >= ARRAY_SIZE(b->entries)); b->entries[b->nr++] = (struct time_stat_buffer_entry) { .start = start, - .end = end + .end = end }; if (b->nr == ARRAY_SIZE(b->entries)) { @@ -293,7 +292,7 @@ void bch2_time_stats_update(struct time_stats *stats, u64 start) for (i = b->entries; i < b->entries + ARRAY_SIZE(b->entries); i++) - __bch2_time_stats_update(stats, i->start, i->end); + bch2_time_stats_update_one(stats, i->start, i->end); spin_unlock_irqrestore(&stats->lock, flags); b->nr = 0; |