block: use current active bfqq to update statistics
Use the current active bfq-queue to update bfq-group statitics.
It could be possible that the current active serving bfq-queue can
expire if the allocated time/budget for the queue got expired.
During this time, it will select a new queue that to be served
for its service tree.
If there were no more queues to be served, then it will choose a
next group of queues to be served from its group service tree.
So, the selection of the new request from its new group and queue
are updated via __bfq_dispatch_request() fn.
As "in_serv_queue" variable is not updated again the group
associated with "in_serv_queue" queue can be freed, if there were
no more active queues.
So, with picking in_serv_queue as active queue, and updating its group
statistics one will see a kernel panic as below.
[ 120.572960] Hardware name: Qualcomm Technologies, Inc. Lito MTP (DT)
[ 120.572973] Workqueue: kblockd blk_mq_run_work_fn
[ 120.572979] pstate: a0c00085 (NzCv daIf +PAN +UAO)
[ 120.572987] pc : bfqg_stats_update_idle_time+0x14/0x50
[ 120.572992] lr : bfq_dispatch_request+0x398/0x948
[ 121.185249] Call trace:
[ 121.187772] bfqg_stats_update_idle_time+0x14/0x50
[ 121.192700] bfq_dispatch_request+0x398/0x948
[ 121.197187] blk_mq_do_dispatch_sched+0x84/0x118
[ 121.198270] CPU7: update max cpu_capacity 1024
[ 121.206504] blk_mq_sched_dispatch_requests+0x130/0x190
[ 121.211873] __blk_mq_run_hw_queue+0xcc/0x148
[ 121.216359] blk_mq_run_work_fn+0x24/0x30
[ 121.220489] process_one_work+0x328/0x6b0
[ 121.224619] worker_thread+0x330/0x4d0
[ 121.228475] kthread+0x128/0x138
[ 121.231806] ret_from_fork+0x10/0x1c
To avoid this, always use the current active bfq-queue, which is
derived from the current active serving request.
Change-Id: I51d5b9d2020da9f3a3a31378b06257463afd08eb
Signed-off-by:
Pradeep P V K <ppvk@codeaurora.org>
Loading
Please register or sign in to comment