Skip to content

Commit bd3d3ad

Browse files
committed
Merge tag 'block-5.18-2022-04-29' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: - Revert of a patch that caused timestamp issues (Tejun) - iocost warning fix (Tejun) - bfq warning fix (Jan) * tag 'block-5.18-2022-04-29' of git://git.kernel.dk/linux-block: bfq: Fix warning in bfqq_request_over_limit() Revert "block: inherit request start time from bio for BLK_CGROUP" iocost: don't reset the inuse weight of under-weighted debtors
2 parents 63b7b3e + 09df6a7 commit bd3d3ad

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

block/bfq-iosched.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ static bool bfqq_request_over_limit(struct bfq_queue *bfqq, int limit)
569569
struct bfq_entity *entity = &bfqq->entity;
570570
struct bfq_entity *inline_entities[BFQ_LIMIT_INLINE_DEPTH];
571571
struct bfq_entity **entities = inline_entities;
572-
int depth, level;
572+
int depth, level, alloc_depth = BFQ_LIMIT_INLINE_DEPTH;
573573
int class_idx = bfqq->ioprio_class - 1;
574574
struct bfq_sched_data *sched_data;
575575
unsigned long wsum;
@@ -578,15 +578,21 @@ static bool bfqq_request_over_limit(struct bfq_queue *bfqq, int limit)
578578
if (!entity->on_st_or_in_serv)
579579
return false;
580580

581+
retry:
582+
spin_lock_irq(&bfqd->lock);
581583
/* +1 for bfqq entity, root cgroup not included */
582584
depth = bfqg_to_blkg(bfqq_group(bfqq))->blkcg->css.cgroup->level + 1;
583-
if (depth > BFQ_LIMIT_INLINE_DEPTH) {
585+
if (depth > alloc_depth) {
586+
spin_unlock_irq(&bfqd->lock);
587+
if (entities != inline_entities)
588+
kfree(entities);
584589
entities = kmalloc_array(depth, sizeof(*entities), GFP_NOIO);
585590
if (!entities)
586591
return false;
592+
alloc_depth = depth;
593+
goto retry;
587594
}
588595

589-
spin_lock_irq(&bfqd->lock);
590596
sched_data = entity->sched_data;
591597
/* Gather our ancestors as we need to traverse them in reverse order */
592598
level = 0;

block/blk-iocost.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2322,7 +2322,17 @@ static void ioc_timer_fn(struct timer_list *timer)
23222322
iocg->hweight_donating = hwa;
23232323
iocg->hweight_after_donation = new_hwi;
23242324
list_add(&iocg->surplus_list, &surpluses);
2325-
} else {
2325+
} else if (!iocg->abs_vdebt) {
2326+
/*
2327+
* @iocg doesn't have enough to donate. Reset
2328+
* its inuse to active.
2329+
*
2330+
* Don't reset debtors as their inuse's are
2331+
* owned by debt handling. This shouldn't affect
2332+
* donation calculuation in any meaningful way
2333+
* as @iocg doesn't have a meaningful amount of
2334+
* share anyway.
2335+
*/
23262336
TRACE_IOCG_PATH(inuse_shortage, iocg, &now,
23272337
iocg->inuse, iocg->active,
23282338
iocg->hweight_inuse, new_hwi);

block/blk-mq.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,14 +1131,7 @@ void blk_mq_start_request(struct request *rq)
11311131
trace_block_rq_issue(rq);
11321132

11331133
if (test_bit(QUEUE_FLAG_STATS, &q->queue_flags)) {
1134-
u64 start_time;
1135-
#ifdef CONFIG_BLK_CGROUP
1136-
if (rq->bio)
1137-
start_time = bio_issue_time(&rq->bio->bi_issue);
1138-
else
1139-
#endif
1140-
start_time = ktime_get_ns();
1141-
rq->io_start_time_ns = start_time;
1134+
rq->io_start_time_ns = ktime_get_ns();
11421135
rq->stats_sectors = blk_rq_sectors(rq);
11431136
rq->rq_flags |= RQF_STATS;
11441137
rq_qos_issue(q, rq);

0 commit comments

Comments
 (0)