Revert "block: use current active bfqq to update statistics"

Revert to reduce upstream merge conflicts.

This reverts commit 1852d0be8d.

Change-Id: I41def223623912099d3b35c3693b297762419eec
This commit is contained in:
Michael Bestas 2022-11-22 20:34:43 +02:00
parent 71fe1ea786
commit 5fd262602e
No known key found for this signature in database
GPG key ID: CC95044519BE6669

View file

@ -4001,6 +4001,7 @@ exit:
#if defined(CONFIG_BFQ_GROUP_IOSCHED) && defined(CONFIG_DEBUG_BLK_CGROUP)
static void bfq_update_dispatch_stats(struct request_queue *q,
struct request *rq,
struct bfq_queue *in_serv_queue,
bool idle_timer_disabled)
{
struct bfq_queue *bfqq = rq ? RQ_BFQQ(rq) : NULL;
@ -4022,15 +4023,17 @@ static void bfq_update_dispatch_stats(struct request_queue *q,
* bfqq_group(bfqq) exists as well.
*/
spin_lock_irq(q->queue_lock);
if (bfqq && idle_timer_disabled)
if (idle_timer_disabled)
/*
* It could be possible that current active
* queue and group might got updated along with
* request via. __bfq_dispatch_request.
* So, always use current active request to
* derive its associated bfq queue and group.
* Since the idle timer has been disabled,
* in_serv_queue contained some request when
* __bfq_dispatch_request was invoked above, which
* implies that rq was picked exactly from
* in_serv_queue. Thus in_serv_queue == bfqq, and is
* therefore guaranteed to exist because of the above
* arguments.
*/
bfqg_stats_update_idle_time(bfqq_group(bfqq));
bfqg_stats_update_idle_time(bfqq_group(in_serv_queue));
if (bfqq) {
struct bfq_group *bfqg = bfqq_group(bfqq);
@ -4043,6 +4046,7 @@ static void bfq_update_dispatch_stats(struct request_queue *q,
#else
static inline void bfq_update_dispatch_stats(struct request_queue *q,
struct request *rq,
struct bfq_queue *in_serv_queue,
bool idle_timer_disabled) {}
#endif
@ -4065,7 +4069,7 @@ static struct request *bfq_dispatch_request(struct blk_mq_hw_ctx *hctx)
spin_unlock_irq(&bfqd->lock);
bfq_update_dispatch_stats(hctx->queue, rq,
bfq_update_dispatch_stats(hctx->queue, rq, in_serv_queue,
idle_timer_disabled);
return rq;