Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cpumask: set nr_cpumask_bits to nr_cpu_ids on PREEMPT_RT
- As we have CPUMASK_OFFSTACK disabled on RT, we end up having the cpumap
- and cpumask set with the full NR_CPUS size, 5120 bits. That causes
- /sys/devices/system/node/nodeX/cpumap to display a huge array of values
- instead of the cpumap containing the amount of CPUs supported by the system.
- Example:
- # cat /sys/devices/system/node/node0/cpumap
- 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f
- With CPUMASK_OFFSTACK enabled we would have:
- # cat /sys/devices/system/node/node0/cpumap
- f
- That difference confuses libvirt, that fails to get the CPU info. Maybe other
- applications are affected by that too.
- The proposed change gets the desired behavior and decreases the size of the
- cpumask considerably for smaller systems.
- Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
- diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
- index d08e4d2a..c7c2ec7 100644
- --- a/include/linux/cpumask.h
- +++ b/include/linux/cpumask.h
- @@ -28,7 +28,7 @@ typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
- extern int nr_cpu_ids;
- #endif
- -#ifdef CONFIG_CPUMASK_OFFSTACK
- +#if defined(CONFIG_CPUMASK_OFFSTACK) || defined(CONFIG_PREEMPT_RT_BASE)
- /* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also,
- * not all bits may be allocated. */
- #define nr_cpumask_bits nr_cpu_ids
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement