cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joshkern
Visitor
Visitor
9,379 Views
Registered: ‎08-05-2015

Userspace Application vs Kernel Application

I'm comparing latencies between the two different Matrix Multiply applications in OpenAMP (kernelspace and userspace). One test that I'm doing is seeing how long it takes between rpmsg_sendto() and the callback function being called. I'm using the getnstimeofday() function to conduct this test. Something strange I noticed is the latency in the kernelspace application is only about 14ms while the userspace application has a latency of about 150ms. What could account for this difference?

0 Kudos
Reply
3 Replies
joshkern
Visitor
Visitor
9,164 Views
Registered: ‎08-05-2015

So I've found the culprit to this extra delay. It is caused by the call to outer_flush_range() in the handle_event() function of zynq_remoteproc_driver.c. I'm not familiar with this kind of cache function, so I'm not sure what the purpose of it is in the context of this program or for remoteproc/rpmsg in general. Can anyone give me an answer? From my tests, commenting out the line doesn't effect the program's output at all, at least for the matrix multiply example (tested both userspace and kernelspace versions).

0 Kudos
Reply
linnj
Xilinx Employee
Xilinx Employee
9,091 Views
Registered: ‎09-10-2008

Hi Josh,

The outer cache is the L2 while the inner is L1 on Zynq. You might get lucky and it will work but I don't know if that is a reliable solution. It does make some sense to me that user space is going to be slower than kernel space but I don't have enough experience in that area to say if the delta is reasonable to expect. Sounds kind of big for sure but I don't believe the OpenAMP solution has been optimized in general.

Thanks
John
0 Kudos
Reply
joshkern
Visitor
Visitor
9,079 Views
Registered: ‎08-05-2015

Just came across the latest commit of zynq_remoteproc.c on the linux-xlnx repository on Github. Looks like they removed this cache flush:

 

There is no need in the zynq remoteproc driver to flush the cache
because the remoteproc is using DMA memory for virtio queues and
buffers.

 

0 Kudos
Reply