1

I am looking for a way to synchronize a kernel driver and some user-land code (without any copy_to_user or polling on a mmap)

More explanation:

My user side code read some data in a shared mmap, but it needs to know when the data are ready from the driver I already try to use signals to schedule everything but performances are even lower than using a regular char device (with a copy_to user)

(Working on a 4.1.15 kernel)

Any idea ?

[EDIT] I trying to do it with msync now

Cijay
  • 51
  • 5
  • Does the driver not face the other side of the issue -- knowing when it can safely modify the contents of the mapped memory? How does it address that, and why does that not yield a solution for the userland side as well? – John Bollinger Mar 12 '19 at 18:49
  • The mmap is a circular buffer where the driver writes data and keeps track of the write_offset. Named semaphore would have been perfect here, but there is no implementation on the kernel side. – Cijay Mar 12 '19 at 19:49

0 Answers0