Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nashif opened this issue Oct 31, 2024 · 0 comments · Fixed by #80702
Closed

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

nashif opened this issue Oct 31, 2024 · 0 comments · Fixed by #80702
Assignees
Labels
area: ARM ARM (32-bit) Architecture area: Kernel bug The issue is a bug, or the PR is fixing a bug Release Blocker Use this label for justified release blockers

Comments

@nashif
Copy link
Member

nashif commented Oct 31, 2024

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.

@nashif nashif added bug The issue is a bug, or the PR is fixing a bug area: Kernel area: ARM ARM (32-bit) Architecture Release Blocker Use this label for justified release blockers labels Oct 31, 2024
nashif added a commit to nashif/zephyr that referenced this issue Oct 31, 2024
This reverts commit 773739a.

Fixes zephyrproject-rtos#80701

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
nashif added a commit to nashif/zephyr that referenced this issue Oct 31, 2024
This reverts commit 773739a.

Fixes zephyrproject-rtos#80701

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
nashif added a commit to nashif/zephyr that referenced this issue Oct 31, 2024
This reverts commit 773739a.

Fixes zephyrproject-rtos#80701

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
zephyrbot pushed a commit that referenced this issue Nov 1, 2024
This reverts commit 773739a.

Fixes #80701

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit e646b7f)
nashif added a commit that referenced this issue Nov 5, 2024
This reverts commit 773739a.

Fixes #80701

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit e646b7f)
cooked pushed a commit to cooked/zephyr that referenced this issue Nov 6, 2024
This reverts commit 773739a.

Fixes zephyrproject-rtos#80701

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
andrewnyland pushed a commit to onceLabs/zephyr that referenced this issue Nov 6, 2024
This reverts commit 773739a.

Fixes zephyrproject-rtos#80701

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture area: Kernel bug The issue is a bug, or the PR is fixing a bug Release Blocker Use this label for justified release blockers
Projects
None yet
2 participants