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

HS does not calculate CPU utilization correctly on multi-core systems #85

Closed
dmknutsen opened this issue Mar 28, 2023 · 2 comments · Fixed by #90
Closed

HS does not calculate CPU utilization correctly on multi-core systems #85

dmknutsen opened this issue Mar 28, 2023 · 2 comments · Fixed by #90
Assignees
Milestone

Comments

@dmknutsen
Copy link
Contributor

dmknutsen commented Mar 28, 2023

Checklist (Please check before submitting)

  • [x ] I reviewed the Contributing Guide.
  • [x ] I reviewed the README file to see if the feature is in the major future work.
  • [x ] I performed a cursory search to see if the feature request is relevant, not redundant, nor in conflict with other tickets.

Is your feature request related to a problem? Please describe.
HS does not calculate CPU utilization correctly on multi-core systems.

Describe the solution you'd like
HS has only one idle task. Multiple idle tasks would need to be spawned/pinned to each core in an SMP/multi-core setup in order to correctly calculate CPU utilization. Alternatively, OS specific task hooks could be utilized to report the CPU utilization for each core...which would likely be the most accurate/desired approach.

Requester Info
Dan Knutsen
NASA GSFC

@skliper
Copy link
Contributor

skliper commented Mar 28, 2023

@jphickey
Copy link
Contributor

I checked into the various CPU use APIs, but there doesn't seem to be much standardization here across platforms. POSIX does have some limited facilities (e.g. the times() call) but that's really just for the CPU time of the calling process and not for the system as a whole. One can get more detailed information using platform-specific methods, such as querying the /proc filesystem on Linux.

My current thinking is that the abstraction belongs in the PSP in the form of PSP modules - a single "Linux" module could cover all Linux-based boards. The current "idle loop" fallback could be another PSP module where there are no better options (though I'd never recommend using this, except perhaps on the simplest of processors that have no power-management logic, as it will keep the processor "on" all the time and can increase power usage drastically).

jphickey added a commit to jphickey/HS that referenced this issue Apr 13, 2023
Removes all "Custom" routines from HS, and instead calls into PSP via
the new iodriver mechanism.  This is used to obtain average CPU
utilization information rather than an idle task.

This architecuture allows support for many more variables, such as
per-cpu utilization information, temperature, fan speeds, and other health
info.  That is not implemented here, but could be added in the future.
jphickey added a commit to jphickey/HS that referenced this issue Apr 13, 2023
Removes all "Custom" routines from HS, and instead calls into PSP via
the new iodriver mechanism.  This is used to obtain average CPU
utilization information rather than an idle task.

This architecuture allows support for many more variables, such as
per-cpu utilization information, temperature, fan speeds, and other health
info.  That is not implemented here, but could be added in the future.
jphickey added a commit to jphickey/HS that referenced this issue Apr 13, 2023
Removes all "Custom" routines from HS, and instead calls into PSP via
the new iodriver mechanism.  This is used to obtain average CPU
utilization information rather than an idle task.

This architecuture allows support for many more variables, such as
per-cpu utilization information, temperature, fan speeds, and other health
info.  That is not implemented here, but could be added in the future.
dzbaker added a commit that referenced this issue Apr 13, 2023
Fix #85, move system monitoring to PSP
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
@chillfig chillfig added the bug label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants