UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor joshkern
Visitor
8,828 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
3 Replies
Visitor joshkern
Visitor
8,613 Views
Registered: ‎08-05-2015

Re: Userspace Application vs Kernel Application

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
Xilinx Employee
Xilinx Employee
8,540 Views
Registered: ‎09-10-2008

Re: Userspace Application vs Kernel Application

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
Highlighted
Visitor joshkern
Visitor
8,528 Views
Registered: ‎08-05-2015

Re: Userspace Application vs Kernel Application

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