best way to communicate and synchronize between kernel and user space in linux
Hello All,
My objective is to log a lot of activities from kernel. For this I need to write into disk based file systems.
So, I have implemented a character device driver, and a user space process which reads from this virtual device. The driver copies the data into the user space buffer, and the user process writes it into a file.
My problem is how to synchronize the data. I started using kfifo an in kernel implementation for fifo. So wherever I want to log I use the kfifo API for copying data into the fifo. The virtual device driver reads from the fifo and copies it into user space. Since the data being logged is huge I need synchronization such as in producer consumer. Is there any such support in linux kernel which I can use?
Does netlink socket solve such a problem??
|