-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
This commit aims to change the accounting system of CPUs. In some cases, the number of CPUs obtained through the runtime library function is slightly less than the actual/real number of CPUs. This change introduces reading the number of CPUs online through sysfs (/sys/devices/system/cpu/online). Signed-off-by: Eduardo Alberti <eduardo.alberti@windriver.com> Co-authored by: Pedro de Souza Silva <pedro.desouzasilva@windriver.com> Co-authored-by: Eduardo Alberti <eduardo.alberti@windriver.com>
* feat: ACPI integration * Makes EPP a seperate feature * Library tweaked to accept acpi dev * Library altered to accept alternate file system side affect of changing function names to be driver agnostic validated through unit tests and in conjunction with power manager * fix: Adding getNumberOfCpus to libconfig Adding getNumberOfCpus allows us to set the number of available cores. This helps in unit tests, especially since rt.numcpus can break unit tests when a large number of isolcpus are enabled on the system
- moves cores to shared pool in fuzz test to prevent error - adds cstate operation to test
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.4. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](stretchr/testify@v1.8.2...v1.8.4) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs: Updating README to factor in acpi support * adds acpi-cpufreq to readme * renames p-states file to scaling_driver
README.md
Outdated
@@ -23,8 +23,7 @@ This library is currently used as part of the | |||
# Prerequisites | |||
|
|||
- Linux based OS | |||
- P-States | |||
- ``intel_pstates`` enabled - no entries in kernel cmdline disabling it | |||
- P-States or acpi-cpufreq scaling driver enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- P-States or acpi-cpufreq scaling driver enabled | |
- P-State or acpi-cpufreq scaling driver enabled |
pkg/power/README.md
Outdated
|
||
* Performance governor - The CPUfreq governor "performance" sets the CPU statically to the highest frequency within the | ||
borders of scaling_min_freq and scaling_max_freq. | ||
* Powersave governor - The CPUfreq governor "powersave" sets the CPU statically to the lowest frequency within the | ||
borders of scaling_min_freq and scaling_max_freq. | ||
|
||
### acpi-cpufreq | ||
The acpi-cpufreq driver operates much like the P-state driver but has a number of both static and dynamic governors. For more information see [here](https://www.kernel.org/doc/html/v4.12/admin-guide/pm/cpufreq.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The acpi-cpufreq driver operates much like the P-state driver but has a number of both static and dynamic governors. For more information see [here](https://www.kernel.org/doc/html/v4.12/admin-guide/pm/cpufreq.html). | |
The acpi-cpufreq driver setting operates much like the P-state driver but has a different set of available governors. For more information see [here](https://www.kernel.org/doc/html/v4.12/admin-guide/pm/cpufreq.html). |
pkg/power/README.md
Outdated
### acpi-cpufreq | ||
The acpi-cpufreq driver operates much like the P-state driver but has a number of both static and dynamic governors. For more information see [here](https://www.kernel.org/doc/html/v4.12/admin-guide/pm/cpufreq.html). | ||
One thing to note is that acpi-cpufreq reports the base clock as the frequency hardware limits however the P-state driver uses turbo frequency limits. | ||
Both drivers can make use of turbo frequency however acpi-cpufreq will exceed its hardware frequency limits when using turbo frequency. This is important to take into account when setting frequencies for profiles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both drivers can make use of turbo frequency however acpi-cpufreq will exceed its hardware frequency limits when using turbo frequency. This is important to take into account when setting frequencies for profiles. | |
Both drivers can make use of turbo frequency; however, acpi-cpufreq can exceed hardware frequency limits when using turbo frequency. This is important to take into account when setting frequencies for profiles. |
pkg/power/cpu_test.go
Outdated
@@ -110,7 +113,7 @@ func setupCpuPStatesTests(cpufiles map[string]map[string]string) func() { | |||
// revert get number of system cpus function | |||
getNumberOfCpus = origGetNumOfCpusFunc | |||
// revert p-states feature to un initialised state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably want to update this comment.
pkg/power/cpu_test.go
Outdated
@@ -140,7 +143,7 @@ func TestNewCore(t *testing.T) { | |||
}, cpu) | |||
|
|||
// now "break" P-States by setting a feature error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably want to update this comment.
pkg/power/scaling_driver.go
Outdated
} | ||
return cpu.setPStatesValues(defaultPowerProfile) | ||
return cpu.setDriverValues(defaultPowerProfile) | ||
} | ||
|
||
// setPStatesValues is an entrypoint to P-States feature consolidation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// setPStatesValues is an entrypoint to P-States feature consolidation | |
// setDriverValues is an entrypoint to power governor feature consolidation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes added in single-comments. Apologies on that. I started, then was committed. Will approve after changes are done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, but not blocking
exclusivePools: PoolList{}, | ||
featureStates: &featureList, | ||
} | ||
|
||
host.featureStates = &featureList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small question: why is this needed? It seems like we're doing the same thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't remember exactly why I did this but I think it was because I was getting some weird behavior where the host was using a snapshot of the pointers' value instead of the pointer itself. Think this was just for the purposes of debugging to see the field go from unassigned to assigned but probably best to leave as is right now just in case and revert it for next time around
Release to support ACPI Driver