Article 6FQRB Why does the Linux block layer limit the number of requests(tags) that can be dispatched to driver?

Why does the Linux block layer limit the number of requests(tags) that can be dispatched to driver?

by
plznobug
from LinuxQuestions.org on (#6FQRB)
I have been studying the Linux kernel's block layer recently and have several questions that I can't figure out.

Currently, I know that upper layer IO enters the Linux block layer through submit_bio, which then calls make_request to obtain a request and puts it into a software queue (ctx->list or scheduler queue). Then, the queue_rq function is called to issue the request to the driver. This raises the following questions:

(1) If the scheduler is not enabled, the request is put into ctx->list before calling queue_rq to issue it to the driver. Why not directly call queue_rq to issue the request to the driver? It seems that putting the request into ctx->list has no meaning.

(2) If the scheduler is enabled, the request entering the scheduler queue needs to obtain a sched_tag, and if it fails to obtain one, the process will be blocked. Why is there a need to limit the number of requests entering the scheduler queue?

(3) When issuing to the driver, a driver tag needs to be obtained, and if it fails to obtain one, it will be blocked. Similarly, why is there a need to limit the number of requests entering the driver?

For (2) and (3), if unable to obtain tags, they will be blocked. So why not directly let them be issued to the driver since they will be asynchronous and wait for the requests to complete anyway? I don't understand the significance of limiting the quantity.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments