Abhinav Upadhyay @abhi9u.bsky.social · 16/05/2026I wrote a 60-page mini-book on Virtual Memory. Going from what it is, through page tables and down to advanced topics like copy-on write, demand paging, TLB shootdowns, NUMA placement, page reclamation algorithms. blog.codingconfessions.com/p/virtual-me... 1102
Abhinav Upadhyay @abhi9u.bsky.social · 22/12/2025I recently explored how DL frameworks leverage the parallel cores in the GPU to generate random numbers in parallel. 110
Abhinav Upadhyay @abhi9u.bsky.social · 21/09/2025System calls are the interface between the user space and the kernel. They are needed for fundamental things like reading a file, and making a network call. But they are also very expensive because they need to do things like saving/restoring registers, page table, stack. 121
Reposted by Abhinav UpadhyayTeiva Harsanyi @teivah.dev · 16/09/2025What Makes System Calls Expensive: A Linux Internals Deep Dive. blog.codingconfessions.com/p/what-makes... Another great post by @abhi9u.bsky.social. I learned a lot, including vDSO.blog.codingconfessions.comWhat Makes System Calls Expensive: A Linux Internals Deep DiveAn explanation of how Linux handles system calls on x86-64 and why they show up as expensive operations in performance profiles 0158
Abhinav Upadhyay @abhi9u.bsky.social · 13/07/2025People talk about profiling to find bottlenecks, but no one explains how to fix them. Many devs shoot in the dark and when the optimization backfires, they aren't sure how to proceed. 131
Abhinav Upadhyay @abhi9u.bsky.social · 21/05/2025Skipping computer architecture was my biggest student mistake. Hardware’s execution model dictates memory layout, binaries, compiler output, and runtimes. If you want to build systems, learn how the CPU works. I wrote an article on this: blog.codingconfessions.com/p/seeing-the... 021
Abhinav Upadhyay @abhi9u.bsky.social · 12/04/2025Here’s a fun visual showing how len() finds the length of a list in Python. The size is stored right inside the object, but len() takes a five-pointer detour, only to land back where it started. This is why if not mylist is ~2x faster for emptiness checks! 162
Abhinav Upadhyay @abhi9u.bsky.social · 28/03/2025When you see an expert optimize a piece of code, it may look like dark magic. In reality, these experts have a deep understanding of the entire computing stack, and when they look at an application profile, they quickly understand the bottlenecks. 120
Reposted by Abhinav UpadhyayAbhinav Upadhyay @abhi9u.bsky.social · 19/01/2025How do you fit a 250kB dictionary in 64kB of RAM and still perform fast lookups? For reference, even with gzip -9, you can't compress this file below 85kB. In the 1970s, Douglas McIlroy faced this exact challenge while implementing the spell checker for Unix at AT&T. 1157
Reposted by Abhinav UpadhyaySuvash Thapaliya @suva.sh · 24/03/2025The second post is by @abhi9u.bsky.social on some common CPU architecture concepts (instruction pipelining, memory caching &speculative execution). Abhi has done a great job with the analogies in this one. blog.codingconfessions.com/p/hardware-a...blog.codingconfessions.comHardware-Aware Coding: CPU Architecture Concepts Every Developer Should KnowWrite faster code by understanding how it flows through your CPU 221
Reposted by Abhinav UpadhyayTeiva Harsanyi @teivah.dev · 21/03/2025Hardware-Aware Coding: CPU Architecture Concepts Every Developer Should Know blog.codingconfessions.com/p/hardware-a... Another great post by @abhi9u.bsky.socialblog.codingconfessions.comHardware-Aware Coding: CPU Architecture Concepts Every Developer Should KnowWrite faster code by understanding how it flows through your CPU 232
Abhinav Upadhyay @abhi9u.bsky.social · 17/02/2025Every few years linux distributions decide that they need to make it more difficult for you to generate and find core dump files. Now you need to install a systemd utility to do this. 130
Abhinav Upadhyay @abhi9u.bsky.social · 05/02/2025Woke up to an email from Douglas Mcilroy himself in response to my article on his work on Unix Spell. I am very grateful that he took the time to read and respond to it! PS: I fixed the error he found in the article. Article: blog.codingconfessions.com/p/how-unix-s... 043
Abhinav Upadhyay @abhi9u.bsky.social · 19/01/2025How do you fit a 250kB dictionary in 64kB of RAM and still perform fast lookups? For reference, even with gzip -9, you can't compress this file below 85kB. In the 1970s, Douglas McIlroy faced this exact challenge while implementing the spell checker for Unix at AT&T. 1157
Abhinav Upadhyay @abhi9u.bsky.social · 05/01/2025Some old papers are a joy to read because of their simplicity. This is the abstract from a 1966 paper describing a compression technique for infinite codes. For static data, you know the probabilities of the symbols, and can build a Huffman tree, but for an infinite stream, you can't do that 260
Reposted by Abhinav UpadhyayCodetoday Unlimited @codetodayunlimited.com · 02/01/2025Back to school, time for Free Python Coding Resources for Schools, and by resources we mean our entire curriculum, all video lessons Help us spread the word with school teachers everywhere 50+ hours of lessons covering all levels, beginner to advanced, designed specifically for school children …👇🏻 595
Abhinav Upadhyay @abhi9u.bsky.social · 02/01/2025I noticed that my latest article trending on HN! So it's worth sharing here as well. It is first in a series to cover the internals of context switching in Linux. This one explains the core data structures for process and state management during context switching.blog.codingconfessions.comLinux Context Switching Internals: Part 1 - Process State and MemoryHow does the Linux kernel represent processes and their state: A breakdown of task_struct and mm_struct 0122
Abhinav Upadhyay @abhi9u.bsky.social · 27/12/2024An article I wrote a while back was trending on HN today. It explains the impossibility theorem of clustering, according to which a perfect clustering algorithm is impossible to achieve. 142
Abhinav Upadhyay @abhi9u.bsky.social · 26/12/2024You thought systems programmers don't need to know math? Linux kernel developers prove you wrong by contradiction—they prove corollaries in their comments. 0163
Reposted by Abhinav UpadhyaySam Rose @samwho.dev · 20/12/2024What does it mean for something to be Turing complete? I answer this question, and more, through a series of fully interactive Turing machine simulations! Play, pause, step forwards and backwards, and even write your own Turing machine programs in my latest blog post. samwho.dev/turing-machi... 23523158
Abhinav Upadhyay @abhi9u.bsky.social · 20/12/2024Continuing on the hardware concurrency thread, this paper is a must read. It simplifies reasoning about concurrency on x86 by providing an abstract machine model 031
Abhinav Upadhyay @abhi9u.bsky.social · 08/12/2024What every systems programmer should know about concurrency—a very dense but impactful read. Things like lock free and wait free synchronisation techniques will stop seeming like black box if you understand this. PDF: assets.bitbashing.io/papers/concu... 080
Abhinav Upadhyay @abhi9u.bsky.social · 07/12/2024Ulrich Drepper is a rockstar. I keep running into his papers. This one is on the implementation of thread local storage: PDF: www.akkadia.org/drepper/tls.... 041
Reposted by Abhinav UpadhyayShriram Krishnamurthi @shriram.bsky.social · 02/12/2024Sometimes it takes me 22 years (+ one evening) to write a blog post. Here are my thoughts on "homoiconicity" and, as an alternative, "bicameral syntax". (Warning: 4000 words.) parentheticallyspeaking.org/articles/bic...parentheticallyspeaking.orgBicameral, Not HomoiconicParenthetically Speaking: Articles by Shriram Krishnamurthi 2414039
Abhinav Upadhyay @abhi9u.bsky.social · 27/11/2024When you first learn about the fork() syscall, it can seem magical. How can a single system call produce two different return values at the same time?! In my latest article, I demystify the hidden magic of fork and also show how it is implemented in Linux. blog.codingconfessions.com/p/the-magic-...blog.codingconfessions.comDisillusioning the Magic of the fork System CallHow the kernels implement the fork system call 1164
Abhinav Upadhyay @abhi9u.bsky.social · 26/11/2024Visualising transformers and attention - by none other than 3bluebrown youtu.be/KJtZARuO3JY?...youtu.beVisualizing transformers and attention | Talk for TNG Big Tech Day '24YouTube video by Grant Sanderson 171
Abhinav Upadhyay @abhi9u.bsky.social · 21/11/2024Hacking on some code while Cooper is occupied watching a movie. 020
Abhinav Upadhyay @abhi9u.bsky.social · 20/11/2024Recently, I discovered a hidden Easter egg inside Cpython and I wrote a very short post about it which is trending in a few forums. blog.codingconfessions.com/p/cpython-hi...blog.codingconfessions.comAn Unreachable Hidden XKCD Easter Egg inside CPythonNo, I'm not talking about import antigravity 060
Abhinav Upadhyay @abhi9u.bsky.social · 19/11/2024Ben Affleck's interview on his views on LLMs is going around. I wonder if Matt Damon is somewhere saying this to someone: 051
Reposted by Abhinav UpadhyayStephen Gruppetta @stephengruppetta.com · 16/11/2024I felt I needed to do something to keep my reputation as "The Turtle Guy"—funnily enough, I rarely post about `turtle`, but when I do, people seem to notice… Anyway, for the latest article on The Python Coding Stack, I revisited an old project… www.thepythoncodingstack.com/p/python-tur... 062
Abhinav Upadhyay @abhi9u.bsky.social · 17/11/2024A while back I published a detailed code walkthrough of CPython's GC implementation. But there was a need for a higher level explanation of the overall memory management mechanism of CPython without discussing the code. I did just that in a recent article. Here's a summary: 282
Abhinav Upadhyay @abhi9u.bsky.social · 14/11/2024Are there people here working in compilers or computer architecture space? Would love to diversify my feed. These are the two areas I'm primarily diving into these days. I'm not an expert, but I'm trying to build some fluency in these topics. 200
Abhinav Upadhyay @abhi9u.bsky.social · 13/11/2024Found this Easter egg in the CPython code today. As I looked at it I wondered who is Randall? Is he someone like David Beazely for whom special code was added. Mystery unravelled when reached the last line and found the xkcd reference :) 010
Abhinav Upadhyay @abhi9u.bsky.social · 11/11/2024I wrote an article on why the Pythonic way of checking a list for emptiness is not ambiguous. Whenever that is the case, there are ambiguities surrounding it which can make it look ambiguous as well. blog.codingconfessions.com/p/the-python...blog.codingconfessions.comThe Pythonic EmptinessWhy the Pythonic way of doing emptiness check on sequences is not necessarily ambiguous in most cases 120
Abhinav Upadhyay @abhi9u.bsky.social · 04/11/2024The X86 instruction encoding is atrocious. How does the CPU even decode it?! 010
Abhinav Upadhyay @abhi9u.bsky.social · 04/11/2024The Linux kernel has a JIT compiler for compiling the bytecode of BPF programs into machine code. How does it work? 030
Abhinav Upadhyay @abhi9u.bsky.social · 02/11/2024Love this (new?) fish feature. On doing <Tab> with a partially written man page name, the autocomplete also shows a description of the suggested man pages so I can quickly tell which one I want to look up 000
Abhinav Upadhyay @abhi9u.bsky.social · 02/11/2024Aligning up or down to a power-of-2 boundary is a very common operation. I've seen many people use the % operator to do it. But there is a more efficient way of doing it in just 2 instructions. 000
Abhinav Upadhyay @abhi9u.bsky.social · 30/10/2024Brendan Gregg has been busy. He is now trying to build full stack profiling for GPU kernels, i.e., flame graphs which show all the code right from the CPU down to the last bit of kernel code running on the GPU. He calls it AI flame graphs. It seems he has it ready for the Intel GPUs. 110
Abhinav Upadhyay @abhi9u.bsky.social · 27/10/2024While most compiler courses and books currently teach parsing algorithms from the 70s and 80s, CPython uses a parsing technique published in 2004 and which is still not taught widely. 110
Abhinav Upadhyay @abhi9u.bsky.social · 25/11/2023In the past, I've written a few articles on cpython internals. It's a topic I enjoy a lot and plan to cover more. My latest piece covers a fundamental idea in cpython implementation which underlies the object system codeconfessions.substack.com/p/cpyt… 020
Abhinav Upadhyay @abhi9u.bsky.social · 03/11/2023One of the rare days I had a chance to refer to this for something I'm working on 000
Abhinav Upadhyay @abhi9u.bsky.social · 19/10/2023If you wondered why GPUs are in so much demand and how do they work, then I've got you covered. What Every Developer Should Know About GPUs: codeconfessions.substack.com/p/gpu-…codeconfessions.substack.comWhat Every Developer Should Know About GPU ComputingA primer on GPU architecture and computing 052