Skip to content

Changes to cortex_m swap code have major impact on kernel context switching times. #80701

@nashif

Description

@nashif

Describe the bug

Change (commit 773739a.) in cortex_m swap code that improves maintainability by moving code from asm to c contributues to ~13% of performance degredation when benchmarking context switches and other kernel features.

No functional changes in those commit that would justify leaving them in the tree just for the sake of maintainability.

To Reproduce

Using the thread metric benchmark and other benchmarks we have in the tree we can notice that coop context switching goes down to 9639649 from 10812040 using the thread metric benchmark.

For preemptive context switching:

before change
*** Booting Zephyr OS build v3.6.99-2535-ga2ed8162c8c4 ***
**** Thread-Metric Preemptive Scheduling Test **** Relative Time: 30
Time Period Total:  4753017
 
after
*** Booting Zephyr OS build v3.6.99-2544-g773739a52a1f ***
**** Thread-Metric Preemptive Scheduling Test **** Relative Time: 30
Time Period Total:  4373674

Expected behavior

Performance of kernel and context switching times do not degrade drastically like described above.

Impact

Slow response and context switching times.

Metadata

Metadata

Assignees

Labels

Release BlockerUse this label for justified release blockersarea: ARMARM (32-bit) Architecturearea: KernelbugThe issue is a bug, or the PR is fixing a bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions