I want to know how printk passes the data from the kernel space to the user space. I have heard of relayfs, which provides that the efficient and unified file-system to transfer huge data from the kernel space to user space, whether printk also uses relayfs or it has its own implementation??
printk
does not pass data to user space. It only writes into the kernel ring buffer. Programs like dmesg
bring it outside.
See the documentation for klogctl(2)
(man 2 klogctl
) for reading the kernel ring buffer.