In this introduction to initramfs, Robert Landley mentions the following as the motivation behind ramfs.
But ramdisks actually waste even more memory due to caching. Linux is designed to cache all files and directory entries read from or written to block devices, so Linux copies data to and from the ramdisk into the "page cache" (for file data), and the "dentry cache" (for directory entries). The downside of the ramdisk pretending to be a block device is it gets treated like a block device.
A few years ago, Linus Torvalds had a neat idea: what if Linux's cache could be mounted like a filesystem? Just keep the files in cache and never get rid of them until they're deleted or the system reboots? Linus wrote a tiny wrapper around the cache called "ramfs", and other kernel developers created an improved version called "tmpfs" (which can write the data to swap space, and limit the size of a given mount point so it fills up before consuming all available memory). Initramfs is an instance of tmpfs.
This leads me to believe that ramfs (and consequently initramfs) is a mechanism to expose the internal cache structure as a filesystem - using the initramfs driver.
But isn't the existence of the cache itself dependent on the existence of a block device to cache from? This would mean that even to create a purely RAM-based filesystem, we would need to create (or mock) a block device from where the
ramfs would cache - which looks like the problem introduced by initrd in the first place. I'm sure I am missing something here but I am not sure what.
The cpio archive passed to the kernel can also resides on a block device (harddisk, typically), so in order to mount the initramfs contents wouldn't the kernel still need a filesystem driver?