cpumask
CPU mask library
Cpumasks provide a bitmap suitable for representing the set of CPUs in a system, one bit position per CPU number.
In general, only nr_cpu_ids (<= NR_CPUS) bits are valid.
Refering to cpumask_t in Linux.
Reference:
- https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html
- https://man7.org/linux/man-pages/man3/CPU_SET.3.html
- https://elixir.bootlin.com/linux/v6.11/source/include/linux/cpumask_types.h
Examples
use CpuMask;
const SMP: usize = 32;
let mut cpumask = new;
assert!;
cpumask.set;
assert!;
assert!;
assert_eq!;
assert!;
assert_eq!;
assert_eq!;
let mut oneshot = one_shot;
assert!;
assert!;
assert_eq!;
assert_eq!;
oneshot.set;
assert!;
oneshot.set;
assert!;
assert_eq!;
assert_eq!;
let mut cpumask_full = full;
assert_eq!;
assert_eq!;
assert_eq!;
cpumask_full.set;
assert_eq!;
assert_eq!;