This question seems to be simple, but I want to send an event to notify my user space program that the module buffer is ready to be read.
For example, I have a buffer in my kernel module and its data will be consumed by the user space program. If all the data was consumed, the kernel module has to notify my program when a new data arrived.
It's a typically problem of producer/consumer. The producer is a kernel module and the consumer is a user space program.
Today, I send a signal to my program (event) and access the data buffer using the ioctl function. But I don't know if this approach is good enough to solve this kind of problem. I'm afraid to use netlink or memory mapping unnecessarily to solve this.
wait_queue
and waking it from the kernel thread when they're ready to go? – Lentz