Q&A #30 (2023-10-09)
Answers to questions from the last Q&A thread.
In each Q&A video, I answer questions from the comments on the previous Q&A video, which can be from any part of the course. Transcripts are not available for Q&A videos due to length. I do produce closed captions for them, but Substack still has not enabled closed captions on videos :(
Questions addressed in this video:
[00:03] “What makes the idea of working with 32bit addresses interesting?”
[13:24] “This is definitely not related but I wonder what type of mechanisms do we have to allocate memory without having to worry about the kernel syncing it to the backing storage device before we actually want to do so.
For example in the case of database engines which provide transactional primitives how do they ensure the OS doesn't sync "dirty writes" back to the storage device?”
[20:45] “I could not understand where are these tables actually, and this is where page fault can actually occur? Can page fault occur between every paging level? For example, CPU walked through 2 tables and at the 3rd table it realised the entry/page is unmapped and it threw an interrupt. I am also not sure what page file actually is. When I think each of them separately they make sense but when I think all of them (vas, page, page file, page table, 4-level paging, address translation etc.) together I am getting lost because I don't know where trasition points between them actually are. Can you explain them from top to down one more time?”
[37:30] “This is kind of off-topic and I do not want to bring whole virtual function discussion back but I read an other article in Substack which compares normal functions, function pointers and virtual functions calls and there doesn't seem to be a huge difference in terms of cycle times (there is also benchmark section in the article). If you do not have so many on-topic questions, can you touch this topic once more?”