Repository navigation
Remove the CPU and NUMA topology code that never ran - #27
Merged
Merged
Conversation
docs/CPU_NUMA_TOPOLOGY.md describes placement policies, a topology section in the baseline and validation warnings as if they worked. None of it does: nothing in kerf writes a topology section, so the policies have nothing to act on. The README repeated the claim in its feature list and in a section of its own. Remove the document and what the README says about it. Per-node pool memory, kerf init --memory=SIZE@N, is a different thing that does work, and stays documented. Signed-off-by: Cong Wang <cwang@multikernel.io>
--cpu-affinity, --numa-nodes and --memory-policy came with the first kerf create and never did what their help says. They place CPUs by the NUMA nodes of a topology section in the baseline, and nothing in kerf writes that section, so every policy fell through to the same choice: a run of consecutive free CPU IDs, or else the first free ones. local was the exception, it could only fail. Remove the options and the three allocators, and keep that one choice for --cpu-count. An instance is no longer created with the properties the options left behind, of which cpu-affinity = "compact" was written for every instance because the option defaulted to it. The kernel does not read any of them. Signed-off-by: Cong Wang <cwang@multikernel.io>
With the options of kerf create gone, the rest of the topology code has no way to run. An instance had numa_nodes, cpu_affinity and memory_policy, which only those options set. The overlay wrote them out, the update overlay pinned added CPUs and memory to the first of numa_nodes, and the validator checked them against the topology of the baseline in some 200 lines. The baseline had a topology section of NUMA nodes and a per-CPU record of socket, core and thread. The parser read the first from a section that kerf never writes, nothing set the second, and kerf show printed both when they were there. Remove all of it, with the tests that built these objects by hand. A baseline that carries a topology section is still parsed, the section is skipped. kerf show loses a verbose argument for the baseline, which only the per-CPU record used. The NUMA node of pool memory is not part of this: kerf init --memory=SIZE@N, the numa-node-id it writes and the lookup of a CPU's node in topology.py are unchanged. Signed-off-by: Cong Wang <cwang@multikernel.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kerf advertises CPU and NUMA topology support that it does not have. The placement options of
kerf create, the models behind them and a whole document describe a feature whose input, a topology section in the baseline, nothing in kerf ever writes. This removes all of it until the support is real.Three commits:
1. docs: Remove the CPU and NUMA topology document
Deletes
docs/CPU_NUMA_TOPOLOGY.mdand the README section and feature bullet that pointed at it.2. create: Remove the topology placement options
Removes
--cpu-affinity,--numa-nodesand--memory-policyand the three allocators. Without a topology section every policy made the same choice, a run of consecutive free CPU IDs or else the first free ones, so--cpu-countkeeps exactly that. Instances are no longer created with the inertcpu-affinity,numa-nodesandmemory-policyproperties; the kernel does not read them.3. Remove the topology models that nothing fills in
Removes the instance fields, the overlay code that wrote them, about 200 lines of validator checks, the
TopologySection,NUMANodeandCPUTopologymodels, the parser for the baseline topology section and thekerf showblocks that printed it. A baseline that carries a topology section still parses; the section is skipped.Not changed
Per-node pool memory is a separate, working feature and is untouched:
kerf init --memory=SIZE@N, thenuma-node-idit writes, and the CPU to node lookup intopology.pythatkerf initandkerf cpususe.Relation to #12
#12 makes topology support functional and builds on the code removed here, so it will need a rebase and has to bring back the parts it uses. It also deletes
docs/CPU_NUMA_TOPOLOGY.mditself.User-visible changes
kerf createrejects--cpu-affinity,--numa-nodesand--memory-policy.kerf showno longer prints a "NUMA Topology" block or, with-v, a per-CPU topology block. Neither could appear with a baseline written by kerf.Testing
Full suite: 679 passed, 4 skipped. Pylint is clean. Tests that only built the removed objects by hand are deleted. Not run against a live multikernel host.
🤖 Generated with Claude Code