Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+21 -12
+9 -3
block/bfq-iosched.c
··· 569 569 struct bfq_entity *entity = &bfqq->entity; 570 570 struct bfq_entity *inline_entities[BFQ_LIMIT_INLINE_DEPTH]; 571 571 struct bfq_entity **entities = inline_entities; 572 - int depth, level; 572 + int depth, level, alloc_depth = BFQ_LIMIT_INLINE_DEPTH; 573 573 int class_idx = bfqq->ioprio_class - 1; 574 574 struct bfq_sched_data *sched_data; 575 575 unsigned long wsum; ··· 578 578 if (!entity->on_st_or_in_serv) 579 579 return false; 580 580 581 + retry: 582 + spin_lock_irq(&bfqd->lock); 581 583 /* +1 for bfqq entity, root cgroup not included */ 582 584 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); 584 589 entities = kmalloc_array(depth, sizeof(*entities), GFP_NOIO); 585 590 if (!entities) 586 591 return false; 592 + alloc_depth = depth; 593 + goto retry; 587 594 } 588 595 589 - spin_lock_irq(&bfqd->lock); 590 596 sched_data = entity->sched_data; 591 597 /* Gather our ancestors as we need to traverse them in reverse order */ 592 598 level = 0;
+11 -1
block/blk-iocost.c
··· 2322 2322 iocg->hweight_donating = hwa; 2323 2323 iocg->hweight_after_donation = new_hwi; 2324 2324 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 + */ 2326 2336 TRACE_IOCG_PATH(inuse_shortage, iocg, &now, 2327 2337 iocg->inuse, iocg->active, 2328 2338 iocg->hweight_inuse, new_hwi);
+1 -8
block/blk-mq.c
··· 1131 1131 trace_block_rq_issue(rq); 1132 1132 1133 1133 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(); 1142 1135 rq->stats_sectors = blk_rq_sectors(rq); 1143 1136 rq->rq_flags |= RQF_STATS; 1144 1137 rq_qos_issue(q, rq);