Mike G
Mike G

Reputation: 4959

Disk io queue overflow

From what I understand, the disk device has a queue that stores read/write requests from the linux kernel. What happens when the device doesn't drain the queue fast enough (i.e. overflows)?

Does this queue extend (logically) into DRAM?

can some requests be lost?

Upvotes: 0

Views: 848

Answers (2)

MSalters
MSalters

Reputation: 179819

The queue doesn't extend to RAM. There's a disk cache with dirty pages. The OS really would like to write those to disk. Some programs may even block while they're waiting for their dirty pages to be written. And as programs get blocked, they stop writing further data to disk. Pretty self-limiting, actually.

Upvotes: 0

Marcus Müller
Marcus Müller

Reputation: 36346

Does this queue extend (logically) into DRAM?

Where do you think that queue is in the first place? It's in RAM.

The IO buffering infrastructure of any operating system can only serve the purpose of avoiding blocking whatever program tries to do an IO operation.

E.g. imagine you have a program that writes data to a file. For that reason, it calls a write system call. in the Operating System, that goes to the file system driver, which decides which disk sector gets changed.

Now, that change command goes to the IO subsystem, which puts the command in a queue. If that queue is full, the file system call blocks, ie. the call doesn't complete until there is space in the queue, which means that the write call blocks.

very simple: for as long as your writing device doesn't keep up, your writing program gets stopped in the write call. That's pretty logical. It's like trying to push mail into a full postbox. Until someone takes out the mail at the other end, you can't push in new mail, so the postman will have to wait.

Upvotes: 2

Related Questions