title: What is the best way to communicate a kernel module with a user space program?
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>It's a typically problem of producer/consumer. The producer is a kernel module and the consumer is a user space program.</p>
  
  <p>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.</p>