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

topology-aware: rework building the topology pool tree. #477

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

klihub
Copy link
Collaborator

@klihub klihub commented Mar 10, 2025

This PR reworks and simplifies how the tree of pools is built in the topology-aware policy, using the detected hardware topology.

We now build the tree by walking the topology from sockets to dies to NUMA nodes closest to dies. We assign local CPU and memory close these CPUs in tandem to each pool as we build the tree. Once the tree is built, we go through each pool node again and assign CPUless NUMA nodes to the same nodes where their closest NUMA nodes with CPUs are assigned to.

Like earlier, the tree is constructed to be minimal. If the system has a single socket, we omit the virtual root and use the sole socket as the root pool to represent the whole system (since it would have the same resources as its parent virtual root node). If a socket has a single die, we omit that die from the subtree under the socket (since it would have the same resources as its parent socket node). If a die has a single close NUMA node, we omit the tree node that would represent CPUs close to a die-local NUMA node (since it would have the same resources as its parent die or socket node).

@klihub klihub requested review from askervin and fmuyassarov March 10, 2025 15:39
@klihub klihub force-pushed the devel/topology-aware/refactor-pool-building branch from 2e6bdc1 to 248db90 Compare March 10, 2025 15:44
Reworks and simplify how the tree of pools is built in the
topology-aware policy, based on the detected hardware topology.

We now build the tree by walking the topology from sockets to
dies to NUMA nodes closest to dies. We assign local CPU and
memory close these CPUs in tandem to each pool as we build the
tree. Once the tree is built, we go through each pool node again
and assign CPUless NUMA nodes to the same nodes where their
closest NUMA nodes with CPUs are assigned to.

Like earlier, the tree is constructed to be minimal. If the
system has a single socket, we omit the virtual root and use the
sole socket as the root pool to represent the whole system (since
it would have the same resources as its parent virtual root node).
If a socket has a single die, we omit that die from the subtree
under the socket (since it would have the same resources as its
parent socket node). If a die has a single close NUMA node, we
omit the tree node that would represent CPUs close to a die-local
NUMA node (since it would have the same resources as its parent
die or socket node).

Signed-off-by: Krisztian Litkey <[email protected]>
@klihub klihub force-pushed the devel/topology-aware/refactor-pool-building branch from 248db90 to 464acac Compare March 10, 2025 16:41
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.

1 participant