From 4e2d8ca450f46d09ccf0ab429148895ef68f90b0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 10 Jun 2022 14:07:56 -0700 Subject: [PATCH] BACKPORT: FROMLIST: block/bfq: Enable I/O statistics BFQ uses io_start_time_ns. That member variable is only set if I/O statistics are enabled. Hence this patch that enables I/O statistics at the time BFQ is associated with a request queue. Compile-tested only. Reported-by: Cixi Geng Cc: Cixi Geng Cc: Jan Kara Cc: Yu Kuai Cc: Paolo Valente Signed-off-by: Bart Van Assche [ bvanassche: Left out the blk_stat_disable_accounting() call since ] [ commit 68497092bde9 ("block: make queue stat accounting a ] [ reference") from kernel v5.17 has not been backported to the ] [ android13-5.15 branch. ] Bug: 235453574 Link: https://lore.kernel.org/linux-block/20220613163234.3593026-1-bvanassche@acm.org/T/#u Change-Id: I5fad0fb3c7e9c6007aadd94ebb73d91c41143549 Signed-off-by: Bart Van Assche --- block/bfq-iosched.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 4b862f18f4b2..688af8beb0fd 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -132,6 +132,7 @@ #include "blk-mq-tag.h" #include "blk-mq-sched.h" #include "bfq-iosched.h" +#include "blk-stat.h" #include "blk-wbt.h" #define BFQ_BFQQ_FNS(name) \ @@ -7038,6 +7039,8 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e) bfq_init_entity(&bfqd->oom_bfqq.entity, bfqd->root_group); wbt_disable_default(q); + blk_stat_enable_accounting(q); + return 0; out_free: