Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Release v1.3.0 ACPI Driver #12

Merged
merged 6 commits into from
Jul 31, 2023
Merged

Release v1.3.0 ACPI Driver #12

merged 6 commits into from
Jul 31, 2023

Conversation

KingKoopasGoomba
Copy link
Contributor

@KingKoopasGoomba KingKoopasGoomba commented Jul 26, 2023

Release to support ACPI Driver

ejalberti and others added 5 commits July 26, 2023 17:22
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- P-States or acpi-cpufreq scaling driver enabled
- P-State or acpi-cpufreq scaling driver enabled


* 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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).

### 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@@ -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
Copy link
Contributor

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.

@@ -140,7 +143,7 @@ func TestNewCore(t *testing.T) {
}, cpu)

// now "break" P-States by setting a feature error
Copy link
Contributor

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.

}
return cpu.setPStatesValues(defaultPowerProfile)
return cpu.setDriverValues(defaultPowerProfile)
}

// setPStatesValues is an entrypoint to P-States feature consolidation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// setPStatesValues is an entrypoint to P-States feature consolidation
// setDriverValues is an entrypoint to power governor feature consolidation

Copy link
Contributor

@catblade catblade left a 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.

Copy link
Contributor

@madalazar madalazar left a 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

Comment on lines 43 to +45
exclusivePools: PoolList{},
featureStates: &featureList,
}

host.featureStates = &featureList
Copy link
Contributor

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

Copy link
Contributor

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

@KingKoopasGoomba KingKoopasGoomba merged commit 2d17ddd into main Jul 31, 2023
@KingKoopasGoomba KingKoopasGoomba deleted the release-v1.3.0 branch July 31, 2023 14:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants