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: Use cpumasks to iterate all possible or online CPUs #721

Open
htejun opened this issue Oct 2, 2024 · 1 comment
Open

topology: Use cpumasks to iterate all possible or online CPUs #721

htejun opened this issue Oct 2, 2024 · 1 comment
Labels
bpf good first issue Good for newcomers help wanted Extra attention is needed rust Rust language

Comments

@htejun
Copy link
Contributor

htejun commented Oct 2, 2024

CPU IDs aren't guaranteed to be consecutive. To iterate all possible or currently online CPUs, the respective cpumask should be iterated. There are several issues in this area:

  • Some are iterating 0 to the number of online CPUS. This is incorrect as CPU IDs can have gaps and thus can miss higher numbered CPUs.
  • Some are iterating 0 to nr_cpu_ids. This is correct but not ideal in that the CPU IDs can have substantial gaps not online or unallocated.
  • The possible and online cpumasks can be accessed from BPF side using scx_bpf_get_possible_cpumask() and scx_bpf_get_online_cpumask(), respectively. However, scx_utils::toplogy doesn't expose the current possible or online CPU masks that are available through /sys/devices/system/cpu/possible and online.

Make scx_utils::topology expose the cpumasks and make all schedulers use the appropriate cpumask for iteration in both userspace and BPF code.

@uran0sH
Copy link

uran0sH commented Oct 17, 2024

If no one works on it, I would like to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bpf good first issue Good for newcomers help wanted Extra attention is needed rust Rust language
Projects
None yet
Development

No branches or pull requests

3 participants