Skip to content

Unsatisfactory kernel benchmark results on SAM E-70 Xplained #8138

@tgorochowik

Description

@tgorochowik

Hello all

Note: this issue was first noticed by @jukkar in #7907

It seems that context switching and other operations on sam e-70 are slower than they should be. Below are the results of a benchmark running on sam e-70 vs frdm k64f.

sam e-70 xplained:

***** Booting Zephyr OS v1.12.0-rc2-75-g7a18b083e *****
starting test - Time Measurement
Timing Results: Clock Frequency: 300 MHz
Tick overhead                                : 730 cycles ,  2433 ns
Thread Creation                              :1340 cycles ,  4466 ns
Thread cancel                                : 634 cycles ,  2113 ns
Thread abort                                 :1906 cycles ,  6353 ns
Thread Suspend                               :2024 cycles ,  6746 ns
Thread Resume                                :1950 cycles ,  6500 ns
Thread Yield                                 :1487 cycles ,  4956 ns
Thread Sleep                                 :1810 cycles ,  6033 ns
Heap Malloc                                  :3476 cycles , 11586 ns
Heap Free                                    :3081 cycles , 10270 ns
Semaphore Take with context switch           :2224 cycles ,  7413 ns
Semaphore Give with context switch           :2740 cycles ,  9133 ns
Semaphore Take without context switch        : 318 cycles ,  1060 ns
Semaphore Give without context switch        : 872 cycles ,  2906 ns
Mutex lock                                   : 752 cycles ,  2506 ns
Mutex unlock                                 :1047 cycles ,  3490 ns
Message Queue Put with context switch        :3154 cycles , 10513 ns
Message Queue Put without context switch     :1172 cycles ,  3906 ns
Message Queue get with context switch        :3564 cycles , 11880 ns
Message Queue get without context switch     :1232 cycles ,  4106 ns
MailBox synchronous put                      :3916 cycles , 13053 ns
MailBox synchronous get                      :3724 cycles , 12413 ns
MailBox asynchronous put                     :1688 cycles ,  5626 ns
MailBox get without context switch           :3164 cycles , 10546 ns
Timing Measurement  finished
PASS - main
===================================================================
===================================================================
PROJECT EXECUTION SUCCESSFUL

frdm k64f:

***** Booting Zephyr OS v1.12.0-rc2-75-g7a18b083e *****
starting test - Time Measurement
Timing Results: Clock Frequency: 120 MHz
Tick overhead                                : 186 cycles ,  1550 ns
Thread Creation                              : 335 cycles ,  2791 ns
Thread cancel                                : 109 cycles ,   908 ns
Thread abort                                 : 435 cycles ,  3625 ns
Thread Suspend                               : 465 cycles ,  3875 ns
Thread Resume                                : 480 cycles ,  4000 ns
Thread Yield                                 : 407 cycles ,  3391 ns
Thread Sleep                                 : 450 cycles ,  3750 ns
Heap Malloc                                  : 846 cycles ,  7050 ns
Heap Free                                    : 767 cycles ,  6391 ns
Semaphore Take with context switch           : 570 cycles ,  4750 ns
Semaphore Give with context switch           : 585 cycles ,  4875 ns
Semaphore Take without context switch        :  59 cycles ,   491 ns
Semaphore Give without context switch        : 193 cycles ,  1608 ns
Mutex lock                                   : 235 cycles ,  1958 ns
Mutex unlock                                 : 291 cycles ,  2425 ns
Message Queue Put with context switch        : 675 cycles ,  5625 ns
Message Queue Put without context switch     : 268 cycles ,  2233 ns
Message Queue get with context switch        : 770 cycles ,  6416 ns
Message Queue get without context switch     : 270 cycles ,  2250 ns
MailBox synchronous put                      : 865 cycles ,  7208 ns
MailBox synchronous get                      : 825 cycles ,  6875 ns
MailBox asynchronous put                     : 435 cycles ,  3625 ns
MailBox get without context switch           : 730 cycles ,  6083 ns
Timing Measurement  finished
PASS - main
===================================================================
===================================================================
PROJECT EXECUTION SUCCESSFUL

What was checked so far:

  • There doesn't seem to be any defconfig differences that could add such overhead
  • Clock settings on same70 seem to be correct according to the datasheet

Is there any reason why sam-e70 would need much more time perform the same task despite having a faster clock? Is there any room for improvements? Any insights or explanations are welcome!

Thank you!

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions