SupercellmJFn27

Improving low-level device knowledge?

Where to go for better understanding of modern storage HW, DMA, PCI buses? I’ve always been the sort of person who likes to really understand how stuff works under the hood. Latency and performance has always been close to my heart. I have a good understanding of CPU and GPU optimization, can read assembly easily for x86 and ARM, have good knowledge of Linux kernel internals as well as networking hardware. On the other hand, the PCI bus, how DMA works, how modern disks work has been a black box for me. I know that DMA is basically copying data to memory without the CPU, but understanding in depth how it relates to memory controllers and CPU caches I’m somewhat clueless about. What should I read to get a deeper understanding of how devices interact with buses and memory as well as modern storage devices? I don’t care about the electrical specs, although understanding power consumption related issues would be interesting.

Qualcomm ZenMode2 Jul 12, 2023

First step would be picking your target platform. The details you are looking for vary based on the underlying hardware.

Supercell mJFn27 OP Jul 12, 2023

For specifics it would be the PC. However, I’m also interested in design choices that HW engineers need to make.

HCL Rcheus Jul 12, 2023

Isn't, what every programmer needs to know about memory covers DMA ? Agner fog might help too.

Supercell mJFn27 OP Jul 12, 2023

I’ve read all of Agner’s optimization manuals probably for the first time when he started publishing them. They do not discuss PCI, DMA or storage devices. It’s CPU caches, instruction details, SIMD etc. and this stuff I’m very familiar with.

Supercell mJFn27 OP Jul 12, 2023

Checked Drepper’s paper, since I have skimmed it back when it was published and it does have some info on DMA. Need to check it more thoroughly if it contains much info beyond what I already know.

Amazon pip_nation Jul 12, 2023

Oh man I'm knee deep in that shit. Doing low level work for AI accelerators. It's allllll PCIe, remote DMA etc. DMA has a controller and descriptors that can copy A to B without CPU involvement. PCIe is a big thing with the root complex n shit.

Supercell mJFn27 OP Jul 12, 2023

So where to start reading about it?

Amazon pip_nation Jul 12, 2023

A lot can simply be read on wiki or chat GPT. Compiling Linux from scratch for little micros can teach a lot. I learned a lot from a DE10 Nano dev board (DE10 Mister).

Ford Motor Company baklavas… Jul 12, 2023

Following

Cisco sancisco Jul 12, 2023

Interested to know