title: Time is not synchronized between userspace and kernel
body: <p>I'm trying to measure the lateny between kernel and userspace, by triggering periodic timer every 1 second, and notifying userspace of the event (using ioctl , and <code>wake_up_interruptible</code>.</p>
  
  <p>For this I created a kernel module which is using hrtimer, and userspace test which is waiting for events.
  the kernel module is using</p>
  
  <p>in kernel:  <code>getnstimeofday()</code>,</p>
  
  <p>and to get the time, and the userspace is using: </p>
  
  <p>in userspace: <code>clock_gettime()</code>.</p>
  
  <p>But the amazing thing is that I see that the results timing from userspace and kernel is not synchronized !</p>
  
  <p><strong>1st event:</strong></p>
  
  <p><em>userspace: 8866[sec] 896197992[nsec] ; kernel: 1388251190[sec] 442706727[nsec]</em></p>
  
  <p><strong>2nd event:</strong></p>
  
  <p><em>userspace: 8867[sec] 896151470[nsec] ; kernel: 1388251191[sec] 442690693[nsec]</em></p>
  
  <p><strong>As you can see kernel and userspace clock is not synchronized, 
  so I can't really measure latency between kernel and userspace events, Right ?</strong></p>
  
  <p>Thank you for any idea,
  Ran</p>