This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM57X: Context switch latency

Part Number: PROCESSOR-SDK-AM57X


Hello,

Software: PROCESSOR-SDK-LINUX-RT-AM57X V04.03

Hardware: AM574X-IDK

I m measuring the overhead of context switch by lat_ctx which is mentioned on this page. The result show that it spends around 10~15us on context switch each time which is more than I expected. Is the number reasonable? If it is, do we have any ways to optimize the overhead? Like increasing CPU clock, or upgrade Linux version? Thanks for any comment.

root@am57xx-evm:~# uname -a
Linux am57xx-evm 4.9.65-rt23-g7069a470d5 #2 SMP PREEMPT RT Mon Mar 26 12:04:24 EDT 2018 armv7l GNU/Linux
root@am57xx-evm:~# ./lat_ctx -s 0 processes 2 4 8 16 20 "size=0k ovr=6.05 2 10.13 4 13.85 8 14.26 16 14.16 20 13.68 root@am57xx-evm:~# ./lat_ctx -s 0 processes 2 4 8 16 20 "size=0k ovr=6.14 2 10.25 4 13.12 8 14.34 16 14.65 20 14.32 root@am57xx-evm:~# ./lat_ctx -s 0 processes 2 4 8 16 20 "size=0k ovr=6.24 2 10.08 4 12.83 8 13.90 16 14.02 20 13.94

  • Hello,

    The SDK you are using is beyond our support window. It would be best to move to a later SDK. We publish results for lat_ctx in our performance guide which can be found here for the RT kernel:

    http://software-dl.ti.com/processor-sdk-linux/esd/docs/06_00_00_07/linux/Release_Specific_Performance_Guide.html#rt-kernel-performance-guide

    What are you basing your expectations on? Or, why do you feel that this is not the expected performance?

    Thank you.

  • Hello,

    It is nice that you have run the benchmark for the latest kernel version. But why the time of lat_ctx-4-256k is 0?

    lat_ctx-2-128k (us) 4.79
    lat_ctx-2-256k (us) 4.00
    lat_ctx-4-128k (us) 8.07
    lat_ctx-4-256k (us) 0.00

    >What are you basing your expectations on? Or, why do you feel that this is not the expected performance?

    I expect that it spends 1 or 2 us on context switch for simple applications like notepad.

    Lets say we have one program A which is not so smart and sleep per ms by calling usleep(1000). This program A causes context-switch two times (others -> A and A -> others) per ms. Assume the overhead of context-switch is around 5 us, then the theoretical value of overhead will be (5 * 2 / 1000) = 1%. 

    So....usleep(1000) wastes the 1% of CPU resource??