Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - EXPENSIVE IO (in32() and out32()) calls in QNX when compared to Linux: (4 Items)
   
EXPENSIVE IO (in32() and out32()) calls in QNX when compared to Linux  
The in32() and out32() IO functions in QNX kernel is taking 2.5 us to execute, when compared to 1 us in Linux kernel. 
The measurement in QNX was done using the Momentics IDE QNX 6.5 ver 4.7.0

I also wrote a sample program by calling a in32() and out32() for over 1000 times and checking the time taken to verify 
this. The test program showed similar results.

It is because of this my driver performance in QNX is (2 – 2.5 times) worse compared to the one in Linux.

The Hardware used was IMX6DQ clocking at 800MHz. The same configuration was used for tests in Linux and QNX.

Can anyone suggest how to optimize the IO operations in QNX? Or any methods to work-around this issue?

In file image001.png, the figure shows the in32() is called a total of 17 times and has 35.37us as total time, this 
translates to 2.08us per in32().

The other tests shows up-to 2.5 us to execute this function.

 

Attachment: Image image001.png 12.11 KB
Re: EXPENSIVE IO (in32() and out32()) calls in QNX when compared to Linux  
Karan Shah schrieb:
> The in32() and out32() IO functions in QNX kernel is taking 2.5 us to execute, when compared to 1 us in Linux kernel.

Are the in32() / out32() function used in kernel or in user space ?

> The measurement in QNX was done using the Momentics IDE QNX 6.5 ver 4.7.0
>
> I also wrote a sample program by calling a in32() and out32() for over 1000 times and checking the time taken to 
verify this. The test program showed similar results.
>
> It is because of this my driver performance in QNX is (2 – 2.5 times) worse compared to the one in Linux.

What compiler versions, compiler options are you using for QNX and 
Linux. Could you show the individual assembler code produced by the 
compiler ?

>
> The Hardware used was IMX6DQ clocking at 800MHz. The same configuration was used for tests in Linux and QNX.
>
> Can anyone suggest how to optimize the IO operations in QNX? Or any methods to work-around this issue?
>
> In file image001.png, the figure shows the in32() is called a total of 17 times and has 35.37us as total time, this 
translates to 2.08us per in32().
>
> The other tests shows up-to 2.5 us to execute this function.

Could you show us the test code in details ??

Regards

Armin

Re: EXPENSIVE IO (in32() and out32()) calls in QNX when compared to Linux  
Dear Armin,

>Are the in32() / out32() function used in kernel or in user space ?
yes, in32 / out32() function are used in user space.

>What compiler versions, compiler options are you using for QNX and 
Linux. Could you show the individual assembler code produced by the 
compiler ?

The Compiler version for QNX is GNU Compiler Collection (4.4.2) and no compiler options which are default in QNX 
Momentics IDE 4.7.0.

The Compiler version for Linux is arm-fsl-linux-gnueabi-gcc and no compiler options.
"arm-fsl-linux-gnueabi-gcc: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared 
libs), for GNU/Linux 2.6.0, stripped"

The test code files for QNX and linux along with assembly codes of both are attached.
In test code I have created local equivalent in32 and out32 functions whose definition is taken from definition of 
original in32 and out32 code from inout.h header file.
Attachment: Text qnx_io_test.c 841 bytes Text linux_io_test.s 2.06 KB Text qnx_io_test_deassemby.txt 4.5 KB Text linux_io_test.c 821 bytes
Re: EXPENSIVE IO (in32() and out32()) calls in QNX when compared to Linux  
Hi Karan,

Can you try measuring the timespan using ClockCycles() instead of the IDE?
You can use the example here -
http://www.qnx.com/support/knowledgebase.html?id=50130000000nbIk. You can
also disable interrupts then re-enable Interrupts after your test using
the InterruptLock/InterruptUnlock APIs which are documented here -
http://www.qnx.com/developers/docs/660/topic/com.qnx.doc.neutrino.lib_ref/t
opic/i/interruptlock.html

Thanks,
Mark