Demand paged shared memory between kernel space and user space
01:36 09 Jun 2026

I have a user space program which loads a kernel module, and the module is going to send logs to the program. I have already implemented this using Netlink but it appeared to me that it is not the most performant mechanism of IPC. Though I have no reason for better performance, I wouldn't mind learning and writing more code for something faster.

I am a bit overwhelmed with what all AI is suggesting what I kept learning. Instead of me listing lots of information that could be in the wrong direction, I want to ask, how can I achieve demand paging in kernel space in softirq context? I have not found any way to get demand paging in softirq context. Even though it should be possible since we are on PREEMPT_RT. I actually can't seem to just reserve virtual memory (get_vm_area() is not exported for use). I want to be able to reserve an amount of virtual memory and instead of allocating pages up-front, we allocate pages on page fault. The kernel is the writer to the shared memory.

c linux linux-kernel shared-memory demand-paging