Obviously, you can use shared memory using copy_from_user etc., you can easily configure the character device driver, basically all you have to do is create file_operation structures, but this is far from the fastest way. I do not have benchmarks, but the system calls of modern systems should be the fastest. My reasoning is that it was most optimized. It used to be that to access the user β to the kernel, it was necessary to create an interrupt, which would then go to the interrupt table (array), then find the handlex interrupt (0x80), and then go into kernel mode. It was very slow, and then the .sysenter instruction appeared, which basically makes this process very fast. Without going into details, .sysenter reads the CS: EIP register form immediately and the change is pretty quick. Shared memory, on the other hand, requires writing and reading from memory, which is infinitely more expensive than reading from a register.
daniel
source share