Settings

Theme

Ask HN: How IO Works?

2 points by atif089 a year ago · 4 comments · 1 min read


I want to learn how I/O works in a reasonable detail.

For instance, when I want to do something with a disk, IIRC, things that get involved are

- Kernel / OS calls (maybe we can skip this) - File System - MBR / GPT - Random v/ Sequential calls

I want to understand what happens in each level. Is there anything I can read to gain understanding of all of these areas?

prosaic-hacker a year ago

This is not a topic that can be explained while standing on one foot. It is a multi layer cake of hand-offs of information similar to the ISO OSI model of networking (which of course is I/O through the network.

At the top end is a program asking built in function or library to print some text. Many layers down is the final hardware receiving the text and displaying it. These two video will cover the lower layers

https://www.youtube.com/playlist?list=PLowKtXNTBypFWff2QjXCW...

https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXN...

NavinF a year ago

Related: https://www.brendangregg.com/Perf/linux_observability_tools....

Usually people who ask questions like this are debugging IO performance issues. That image shows the relevant layers and the tools you use to find issues like write amplification

  • atif089OP a year ago

    Thanks. What sparked my curiosity is while I'm writing code even a small mistake in the most simple programs can cost me tens or hundreds of milliseconds whereas behind a simple flushing to disk command there is so much happening at so many layers all in sub-millisecond or at most in a couple of seconds.

wmf a year ago

I would start with an operating systems textbook or MOOC. Then you have more specific books like Practical File System Design and there are a bunch of Linux kernel books but I'm not sure which ones are good for I/O.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection