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

CPU load halfed after PR #40784 #41792

Closed
alexsven opened this issue Jan 13, 2022 · 7 comments · Fixed by #41914
Closed

CPU load halfed after PR #40784 #41792

alexsven opened this issue Jan 13, 2022 · 7 comments · Fixed by #41914
Assignees
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug

Comments

@alexsven
Copy link
Collaborator

Describe the bug
I noticed that the idle thread in simple samples like blinky is showing 49% cpu load. When checking out the commit just before the PR it shows 99% (as it should).
(#40784)

I've tested blinky for both nRF52840 and nRF5340, both show 49% CPU load for idle after PR, and 99% before the PR.

This PR was submitted by @peter-mitsis

@alexsven alexsven added the bug The issue is a bug, or the PR is fixing a bug label Jan 13, 2022
@nashif nashif added area: Kernel priority: high High impact/importance bug labels Jan 13, 2022
@peter-mitsis
Copy link
Collaborator

Investigating ....

@peter-mitsis
Copy link
Collaborator

Alex,
What steps are you using to reproduce the problem? I ask because I am currently having difficulties just trying to build the blinky sample for the specified boards.

I've been trying to use ...
west build -p -b ./samples/basic/blinky
... to just get a basic build of the sample project but it is giving me Kconfig build errors, for every board name that contains nrf52840 that I have tried so far. At this point, I am assuming that either I have been picking the wrong board, and/or I have a knowledge gap.

@nashif
Copy link
Member

nashif commented Jan 13, 2022

west build -b nrf52840dk_nrf52811 ./samples/basic/blinky works fine...

@alexsven
Copy link
Collaborator Author

I used
west build -b nrf52840dk_nrf52840
and
west build -b nrf5340dk_nrf5340_cpuapp
depending on the board of course

@nordic-krch
Copy link
Contributor

I am able to reproduce it on qemu_86 and qemu_86_64.
For reference, commit before the break: 0bd3d46.
Application i used: 36c210e

Prints 0.0% on 0bd3d46 and

Hello World! qemu_x86_64
load: 57.4%
load: 60.1%
load: 61.6%
load: 62.6%
load: 100.0%

on lastest.

@peter-mitsis
Copy link
Collaborator

I'm able to duplicate it now--also on qemu_x86.

@peter-mitsis
Copy link
Collaborator

I found at least one issue related to the updating of the system's thread_runtime_stats.

  • The total cycles (non-idle) is including the number of idle cycles.

Consequently, the system's execution cycles (sum of total_cycles and idle cycles) ultimately includes the idle cycles twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants