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

scx_layered, cpumask, topology: Cleanups #1083

Merged
merged 7 commits into from
Dec 9, 2024
Merged

Conversation

htejun
Copy link
Contributor

@htejun htejun commented Dec 9, 2024

Things got a bit messy over time e.g. with TopologyMap duplicating parts of Topology and CpuPool having a lot of Topology features. Let's clean them up. This shouldn't cause any behavior changes.

- layered now wraps topology in Arc and stores it in CpuPool::topo.

- CpuPool::nr_cores -> topo.all_cores.len().

- CpuPool::nr_cpus -> NR_CPU_IDS, NR_CPUS_POSSIBLE or topo.all_cpus.len()
  depending on the context. layered is still pretty broken in that it's
  assuming all three values to be equal.

- CpuPool::all_cpus -> topo.all_cpus().

- CpuPool::cpu_core -> topo.all_cpus[].core_id.

- CpuPool::core_cpus usage converted to use topo.all_cores.

- Drop Topology::nr_cpus_online as .all_cpus.len()) providse the same info.

- Drop Toplogy::cpus_bitvec(). No user left.
- Use Cpumask instead BitVec at least in interfaces.

- When BitVec is used use <u64, Lsb0> variant to be compatible with Cpumask.
- Drop Result<> from new().
- Rename interface functions for consistency.
…e &Rhs

Down the line, we should ditch BitVec and convert it into an inline
implementation which is Copy.
- Use information in CpuPool::topo instead.

- Use Cpumasks instead of BitVecs in CpuPool body. CpuPool::cpus_to_cores()
  was incorrectly updated to return Cpumask when it's returning a bitmap of
  cores. Fix it.

- This leaves TopologyMap without any users. Drop it.
Use topo.sibling_cpus() directly instead.
@htejun htejun added this pull request to the merge queue Dec 9, 2024
Merged via the queue into main with commit 27365f7 Dec 9, 2024
46 checks passed
@htejun htejun deleted the htejun/layered-updates-more branch December 9, 2024 21:56
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.

2 participants