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

sysfs, cpuallocator: topology discovery fixes and improvements. #206

Merged

Conversation

klihub
Copy link
Collaborator

@klihub klihub commented Nov 29, 2023

Notes: this patch series is stacked on top of #294.

This patch series improves hardware topology discovery and CPU allocation. The improvements include:

  • fix cache discovery and enable it by default
  • add support for querying CPUs by last-level cache
  • add support for discovering CPU cluster information
  • add support for querying CPUs by die and cluster
  • filtered/logical cluster querying: all 'hyperthread cluster's reported as a single cluster
  • clean up detection and interfaces for online, isolated and offline CPU detection
  • add support for querying possible and present CPUs
  • implement cluster-aware allocation in the CPU allocator.

@klihub klihub requested review from jukkar and fmuyassarov November 29, 2023 09:18
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch 2 times, most recently from 49a0016 to 79015e6 Compare November 30, 2023 17:31
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch from 79015e6 to 06663c7 Compare February 26, 2024 09:07
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch from 06663c7 to 8820726 Compare March 11, 2024 13:32
@klihub klihub requested review from askervin and removed request for jukkar March 11, 2024 13:34
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch 6 times, most recently from c98ff97 to 73963dc Compare March 12, 2024 22:17
@klihub klihub changed the title pkg/sysfs: topology discovery fixes and improvements. sysfs, cpuallocator: topology discovery fixes and improvements. Mar 12, 2024
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch 2 times, most recently from c6a9e24 to e7085e6 Compare March 14, 2024 14:42
@klihub klihub marked this pull request as ready for review March 14, 2024 14:43
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch 4 times, most recently from 894fb23 to 41bb78f Compare March 15, 2024 08:01
Copy link
Collaborator

@kad kad left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@askervin askervin left a comment

Choose a reason for hiding this comment

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

LGTM

@klihub klihub force-pushed the fixes/topology-discovery-improvements branch from 41bb78f to bd6a8d3 Compare March 15, 2024 12:10
@klihub klihub marked this pull request as draft March 15, 2024 17:31
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch from bd6a8d3 to cce7adb Compare March 18, 2024 09:07
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch 2 times, most recently from 84ff7f7 to 5fbc25a Compare March 18, 2024 14:17
@klihub klihub marked this pull request as ready for review March 18, 2024 15:05
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch 2 times, most recently from e915a21 to a61f7eb Compare March 18, 2024 15:47
klihub added 4 commits March 20, 2024 09:38
Implement missing cache discovery bits. Add CPU interface
for querying caches. Enable cache discovery by default.

Signed-off-by: Krisztian Litkey <[email protected]>
Implement DieClusterIDs() and DieClusterCPUSet() for querying
CPU cluster IDs and CPUs per cluster (and per die). There are
two other variants (LogicalDieCluster{IDs,CPUSet}() provided.
These filter out any reported clusters which are hyperthreads
and replace them with a single cluster which contains all the
hyperthreads and has the cluster ID of the lowest CPU.

Signed-off-by: Krisztian Litkey <[email protected]>
Clean up a bit detection of online, offline and isolated CPU sets,
and add more consistent interface names. Add support for querying
possible, and present CPUs as well.

Signed-off-by: Krisztian Litkey <[email protected]>
Try to satisfy satisfy allocation requests consuming one
or more full CPU clusters before falling back to smaller
blocks of allocation. Try to squeeze the full allocation
into a single die or a single package. Don't attempt any
cluster-based allocation if neither of these is possible.

Satisfy low-prio allocations using E-core clusters only.
Use P-core clusters only to satisfy priority preferences
above low-prio.

Signed-off-by: Krisztian Litkey <[email protected]>
@klihub klihub force-pushed the fixes/topology-discovery-improvements branch 2 times, most recently from 0626580 to 774c205 Compare March 20, 2024 07:41
Copy link
Collaborator

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

lgtm

@fmuyassarov fmuyassarov merged commit 7b2fece into containers:main Mar 21, 2024
2 checks passed
@klihub klihub deleted the fixes/topology-discovery-improvements branch March 21, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants