简体   繁体   English

什么使blk_execute_rq_nowait排队的请求出队

[英]what dequeues requests queued by blk_execute_rq_nowait

I'm working on increasing a timeout in the SCSI mid-layer driver in Linux. 我正在努力增加Linux中SCSI中间层驱动程序的超时。 At least, that's the quest. 至少,这就是追求。 I'm familiarizing myself with the driver. 我已经熟悉了驾驶员。 This is turning out to be a formidable task. 事实证明,这是一项艰巨的任务。 The Linux Documentation Project seems to be woefully out of date (the tour of the kernel is based on v 1.0.9 ... really?). Linux Documentation Project似乎已经过时了(内核之旅是基于v 1.0.9 ...真的吗?)。 I also found this from kernel.org. 我也是从kernel.org 找到的 I'm not sure how up-to-date that is either. 我不确定这是什么最新的。

A description of the problem is that we send SCSI commands through sg. 问题的描述是我们通过sg发送SCSI命令。 Any timeout specified in sg_io_hdr_t seems to be ignored if it's longer than 30 seconds. 如果sg_io_hdr_t指定的任何超时时间都超过30秒, sg_io_hdr_t似乎会被忽略。 I haven't seen anything in the sg driver code which seems to trump with 30 if the timeout requested is larger. 我没有在sg驱动程序代码中看到任何内容,如果所请求的超时时间更大,它似乎比30高出很多。 Normally, we submit commands using the write/poll/read method through sg. 通常,我们通过sg使用write / poll / read方法提交命令。 I've traced through the sg code and I believe calling write(2) takes the following path: 我已经遍历了sg代码,并且我相信调用write(2)采用以下路径:

sg_write()
   sg_common_write()
      blk_execute_rq_nowait()

By no means am I 100% positive of this, but it does seem plausible. 我绝对不是对此100%肯定,但这似乎是合理的。 My question to kernel developers here is, what call should I grep for which would dequeue this request? 我对内核开发人员的问题是,我应该对哪个grep调用出队? I haven't found anything in the references I do have which state this. 我没有在引用中找到任何说明此内容的内容。

Ultimately, I'm looking for where, in the mid-layer, requests like this are dequeued for transmission to the lower layer. 最终,我正在寻找在中间层将这样的请求出队以传输到较低层的位置。 My premise is that, if I know what calls dequeues requests from the queue used in blk_execute_rq_nowait(), then I can grep through the appropriate source files looking for that and move from there. 我的前提是,如果我知道什么调用从blk_execute_rq_nowait()中使用的队列中出队请求,那么我可以grep通过适当的源文件来查找并从那里移动。 (If someone would be kind enough to tell me if all of the files listed in the first link are the correct list of files for the SCSI mid-layer in Linux, I thank you in advance. My kernel version: 2.6.32.) (如果有人愿意告诉我第一个链接中列出的所有文件是否都是Linux中SCSI中间层的正确文件列表,我先谢谢您。我的内核版本:2.6.32。)

Do I have things incorrect? 我有不正确的地方吗? Are requests like this just taken by the lower layer? 这样的请求是否仅由较低层处理? I assume "no" because this seems like what the mid-layer is supposed to do: route these things to the proper place. 我假设“否”,因为这似乎是中间层应该做的事情:将这些东西路由到正确的位置。

blk_execute_rq() - this call inserts a request at the back of the I/O scheduler queue. blk_execute_rq() -此调用在I / O调度程序队列的后面插入一个请求。 So you should be looking into the I/O scheduler code which dequeues the requests. 因此,您应该研究使请求出队的I / O调度程序代码。 You may want to start of looking at what I/O scheduler your system is running under,cat /sys/block/sda/queue/scheduler and settings under 您可能要开始查看系统在以下哪个I / O调度程序下运行,cat / sys / block / sda / queue / scheduler和设置在

ls /sys/block/sda/queue/scheduler 

(should be something like noop [deadline] cfq), and thereafter look into the scheduler code. (应该类似于noop [deadline] cfq),然后查看调度程序代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM