1.设置队列的mq_ops(q->mq_ops)为set->ops (例如scsi对应的实现是scsi_mq_ops) 2.设置request超时时间,初始化timeout_work(处理函数是blk_mq_timeout_work) 3.设置队列的make_request回调为blk_mq_make_request (bio的提交时会用到) 4.分配和初始化percpu软件队列(ctx) 5.关联request_queue和块设备的t...
blk_mq_rq_timed_out+0xa0/0xa0 [<ffffffff86d5f6b0>] ? blk_mq_rq_timed_out+0xa0/0xa0 [<ffffffff86d5e33b>] blk_mq_timeout_work+0x8b/0x180 [<ffffffff86abe6bf>] process_one_work+0x17f/0x440 [<ffffffff86abf7d6>] worker_thread+0x126/0x3c0 ... RIP [<ffffffff86d5f628>] ...
INIT_WORK(&q->timeout_work, blk_timeout_work); q->request_fn = rfn; q->prep_rq_fn = NULL; q->unprep_rq_fn = NULL; q->queue_flags |= QUEUE_FLAG_DEFAULT; /* Override internal queue lock with supplied lock pointer */ if (lock) q->queue_lock = lock; /* * This also sets...
return __blk_mq_active_requests(hctx) < depth; }2 changes: 2 additions & 0 deletions 2 include/linux/blkdev.h Original file line numberDiff line numberDiff line change @@ -485,6 +485,8 @@ struct request_queue { struct timer_list timeout; struct work_struct timeout_work; atomic_t...
1127.19.1.el7.x86_64 #1 Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 Workqueue: kblockd blk_mq_timeout_work task: ffff93dbd3fa8000 ti: ffff93dbd3f60000 task.ti: ffff93dbd3f60000 RIP: 0010:[<ffffffff86d5f628>] [<ffffffff86d5f628>] blk_mq_rq_timed_out+0x18/0xa0 ......
unsignedintextra_len;/*length of alignment and padding*/enummq_rq_state state; refcount_tref; unsignedinttimeout; unsignedlongdeadline; union {struct__call_single_data csd; u64 fifo_time; };/** completion callback.*/rq_end_io_fn*end_io;void*end_io_data; ...
blk_exit_queue will free elevator_data, while blk_mq_requeue_work will access it. Move cancel of requeue_work to the front of blk_exit_queue to avoid use-after-free. blk_exit_queue blk_mq_requeue_work __elevator_exit blk_mq_run_hw_queues blk_mq_exit_sched blk_mq_run_hw_queue dd...
voidblk_start_request(struct request *req){blk_dequeue_request(req); /* * We are now handing the request to the hardware, initialize * resid_len to full count and add the timeout han clementine 原创 sunlei0625 2023-05-30 00:16:33 ...
Re: [PATCH V5 3/9] blk-mq: free hw queue's res...Hannes Reinecke Re: [PATCH V5 3/9] blk-mq: free hw queue's...Ming Lei [PATCH V5 2/9] blk-mq: move cancel of requeue_work...Ming Lei Re: [PATCH V5 2/9] blk-mq: move cancel of requ...Johannes Thumshirn ...
> > void blk_mq_release(struct request_queue *q) > > { > > - struct blk_mq_hw_ctx *hctx; > > - unsigned int i; > > + struct blk_mq_hw_ctx *hctx, *next; > > cancel_delayed_work_sync(&q->requeue_work); > > - /* hctx kobj stays in hctx */ ...