LWN: Comments on "The multiqueue block layer" https://lwn.net/Articles/552904/ This is a special feed containing comments posted to the individual LWN article titled "The multiqueue block layer". en-us Mon, 13 Oct 2025 07:26:47 +0000 Mon, 13 Oct 2025 07:26:47 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net The multiqueue block layer https://lwn.net/Articles/810249/ https://lwn.net/Articles/810249/ Bobby999 <div class="FormattedComment"> Hi Neil,<br> <p> I have a question regarding multi-queue (MQ) in SCSI layer. I have read articles and blogs on multi-queue in Linux block layer. Including your brilliant article as well. According to my understanding, since Linux kernel 3.13 (2014), the linux block layer has multi-queue a.k.a mq-blk. And then after mq-blk in block layer, the SCSI IO submission path had to be updated. As a result, SCSI multi-queue a.k.a scsi-mq work has been functional since Linux kernel 3.17.<br> <p> My question is: How actually multi-queuing is achieved in SCSI? AFAIK, traditionally the SCSI mid-level layer used to create queuecommand (). Now when there is multi-queuing implemented in SCSI, does multi-queuing actually means creating multi queuecommand ()? I am struggling to understand the multi-queue mechanism in context of SCSI. I mean where one can see multi-queue in SCSI code?<br> Please help me understand. Thanks :-)<br> </div> Wed, 22 Jan 2020 14:58:08 +0000 The multiqueue block layer https://lwn.net/Articles/810248/ https://lwn.net/Articles/810248/ Bobby999 <div class="FormattedComment"> Hi Jonathan, <br> Hi all,<br> <p> Great article !<br> <p> I have a question regarding multi-queue (MQ) in SCSI layer. I have read articles and blogs on multi-queue in Linux block layer. Since Linux kernel 3.13 (2014), the linux block layer has multi-queue a.k.a mq-blk. And then after mq-blk in block layer, the SCSI IO submission path had to be updated. As a result, SCSI multi-queue a.k.a scsi-mq work has been functional since Linux kernel 3.17.<br> <p> My question is: How actually multi-queuing is achieved in SCSI? AFAIK, traditionally the SCSI mid-level layer used to create queuecommand (). Now when there is multi-queuing implemented in SCSI, does multi-queuing actually means creating multi queuecommand ()? I am struggling to understand the multi-queue mechanism in context of SCSI. I mean where one can see multi-queue in SCSI code?<br> <p> Please help me understand. Thanks :-) <br> </div> Wed, 22 Jan 2020 14:46:30 +0000 The multiqueue block layer https://lwn.net/Articles/747655/ https://lwn.net/Articles/747655/ neilbrown <div class="FormattedComment"> <font class="QuotedText">&gt; Hi, can i ask some questions?</font><br> <p> You are always free to ask :-)<br> <p> I suggest that you read <a href="https://lwn.net/Articles/736534/">https://lwn.net/Articles/736534/</a> and <a href="https://lwn.net/Articles/738449/">https://lwn.net/Articles/738449/</a> as they go in to quite a bit more detail.<br> If something is not clear after reading those, do ask again, either here or in the comments of the relevant other article.<br> <p> </div> Wed, 21 Feb 2018 01:22:43 +0000 The multiqueue block layer https://lwn.net/Articles/747649/ https://lwn.net/Articles/747649/ dusol <div class="FormattedComment"> Hi, can i ask some questions?<br> I'm stuck in understanding kernel multi-queue block layer I/O scheduling algorithm.<br> If my task want to submit bios, it uses function 'generic_make_request(bio)'.<br> I understand that 'generic_make_request(bio)' submit bios to its own software staging queue(one software staging queue per core).<br> This function get block device driver's queue(bdev-&gt;bd_disk-&gt;queue) through bdev_get_queue(bio-&gt;bi_bdev) and then, <br> add bios through a recursive call to generic_make_request(). <br> This article says 'the request queue is split into a number of separate queues'.<br> Are 'request queue' and bdev-&gt;bd_disk-&gt;queue the same thing?<br> I uses kernel linux-4.8.17 version. <br> <p> </div> Wed, 21 Feb 2018 00:10:47 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/554305/ https://lwn.net/Articles/554305/ kleptog <div class="FormattedComment"> Actually, I'd consider write combining something to be done by the disk itself. These days with storage arrays having gigabytes of battery backed storage there's no real reason to have the kernel worry about things like write combining. Maybe if it affected the communication overhead, but that can be dealt with in other ways (like parallel submission).<br> </div> Fri, 14 Jun 2013 06:39:47 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/553323/ https://lwn.net/Articles/553323/ dlang <div class="FormattedComment"> you are processing slices of a range, but are you really writing the adjacent slices at almost exactly the same time from multiple processes? that's what it would take to give the OS the chance to combine the output from the different processes into one write to disk.<br> <p> Also, in HPC aren't you dealing with many different systems accessing your data over the network rather than multiple processes on one machine?<br> <p> What we are talking about here is the chance that things running on different CPUs in a single system are generating disk writes that the OS could combine into a single write before sending it to the drives<br> <p> for reads this isn't as big a deal, readahead should go a long way towards making the issue moot.<br> </div> Fri, 07 Jun 2013 18:18:22 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/553268/ https://lwn.net/Articles/553268/ ejr <div class="FormattedComment"> In my world (HPC), having multiple coordinated processes accessing slices of a range *is* the common case. We have to fight for anything else to have even reasonable performance support. See lustre.<br> <p> But this case often is better handled outside the OS. There could be different interface where clients post their read buffers and the OS fills them in some hardware-optimal order, but that's been considered for &gt;20 years and has no solution yet.<br> </div> Fri, 07 Jun 2013 10:06:21 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/553255/ https://lwn.net/Articles/553255/ dlang <div class="FormattedComment"> when you have things like databases where many applications are accessing one file, how common is it for the different applications to be making adjacent writes at the same time?<br> <p> It may happen, but it's not going to be the common case.<br> </div> Fri, 07 Jun 2013 02:27:24 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/553134/ https://lwn.net/Articles/553134/ alankila <div class="FormattedComment"> The algorithms used for data processing on modern disks are quite fast, for instance lzo compression has bandwidth approaching 1 GB/s per core.<br> </div> Thu, 06 Jun 2013 14:38:18 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/553133/ https://lwn.net/Articles/553133/ axboe <div class="FormattedComment"> If you write programs like that and expect IO performance to be stellar, you have a problem. It's already the case that Linux does not merge IO from independent threads, unless it just happens to either detect this or if explicitly asked to by sharing an IO context.<br> <p> So in general it's not a huge problem. For "legacy" devices that benefit a lot from merging, we can help them out a little bit. They will typically be single queue anyway, and merging at dispatch time on that queue would be trivial to do.<br> </div> Thu, 06 Jun 2013 14:22:33 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/553113/ https://lwn.net/Articles/553113/ ejr <div class="FormattedComment"> See uses of HDF5 and NetCDF file formats. There are many software systems that store in a single, large file, emulating a file system more aligned with the higher-level semantics. Also, think of databases. Counting a case as rare v. common requires an application area.<br> <p> But... Parallel HDF5, etc. interfaces handle some coalescing in the "middleware" layer. They've found that relying on the OS leads to, um, sufficient performance variation across different systems and configurations. Yet another standard parallel I/O layer in user-space could help more than trying to jam the solution into the OS.<br> <p> But relying on user-space won't help the case multiqueue is attacking.<br> </div> Thu, 06 Jun 2013 12:06:35 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/553088/ https://lwn.net/Articles/553088/ dlang <div class="FormattedComment"> a comment I posted elsewhere is also relevant to this discussion. I'll post a link rather than reposting the longer comment<br> <p> in <a rel="nofollow" href="https://lwn.net/Articles/553086/">https://lwn.net/Articles/553086/</a> I talk about how I/O coalescing should only be done when the I/O is busy (among other things)<br> </div> Thu, 06 Jun 2013 07:28:10 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/553084/ https://lwn.net/Articles/553084/ dlang <div class="FormattedComment"> but how many people are running such parallel processing of single files?<br> <p> And of those who are doing so, how much do they care if their files get processed one at a time using every CPU for that one file, or many files at a time with each CPU processing a different file (and therefor not needing the combined I/O logic)<br> <p> Yes, there are going to be some, but is it really worth crippling the more common cases to help this rare case?<br> </div> Thu, 06 Jun 2013 07:08:41 +0000 Hypothetical progams might desire cross-CPU coalescing of IO https://lwn.net/Articles/553076/ https://lwn.net/Articles/553076/ faramir <div class="FormattedComment"> Our worthy editor suggests that not coalescing IO requests across CPUs is probably not a big problem. If we restrict ourselves to the original model of UNIX computation (single process/private memory space), I would agree.<br> <p> If we consider multiple processes with synchronization (perhaps via shared memory), or multi-threaded programs; I'm not so sure. Imagine some kind of processing of file data which can be done a block at a time (say a block based cipher or non-adaptive compression). A multi-threaded/multi-process version of such a program may in fact be running code on multiple CPUs but reading from/writing to the same files (and therefore generating coalescible IO requests.) Reads from the input file could come from any of the threads/processes engaged in the task.<br> <p> In the case of compression; due to variable length output chunks; the writer side will have to be coalesced into a single stream in the program itself in order to put the output in the correct order. Although that might be done by having a management thread simply inform each compression thread when to write; so the actual write calls might still come from different CPUs.<br> <p> A block based cipher program could probably use lseek() on multiple fds opened to the same output file to maintain correct ordering from each thread.<br> <p> In either case, it would appear that coalescing across CPUs would be useful. At least if the actual processing required was negligible relative to IO time. It may be that CPUs aren't fast enough to do this for anything beyond ROT13 encryption or simple RLE compression; so it might not matter for now. But it would seem to be at least be a theoretical issue.<br> </div> Thu, 06 Jun 2013 05:38:38 +0000