SHOW:
|
|
- or go back to the newest paste.
1 | cpumask: set nr_cpumask_bits to nr_cpu_ids on PREEMPT_RT | |
2 | ||
3 | As we have CPUMASK_OFFSTACK disabled on RT, we end up having the cpumap | |
4 | and cpumask set with the full NR_CPUS size, 5120 bits. That causes | |
5 | /sys/devices/system/node/nodeX/cpumap to display a huge array of values | |
6 | instead of the cpumap containing the amount of CPUs supported by the system. | |
7 | ||
8 | Example: | |
9 | ||
10 | # cat /sys/devices/system/node/node0/cpumap | |
11 | 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 | |
12 | ||
13 | With CPUMASK_OFFSTACK enabled we would have: | |
14 | ||
15 | # cat /sys/devices/system/node/node0/cpumap | |
16 | f | |
17 | ||
18 | That difference confuses libvirt, that fails to get the CPU info. Maybe other | |
19 | applications are affected by that too. | |
20 | ||
21 | The proposed change gets the desired behavior and decreases the size of the | |
22 | cpumask considerably for smaller systems. | |
23 | ||
24 | Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com> | |
25 | Signed-off-by: Clark Williams <williams@redhat.com> | |
26 | ||
27 | diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h | |
28 | index d08e4d2a..c7c2ec7 100644 | |
29 | --- a/include/linux/cpumask.h | |
30 | +++ b/include/linux/cpumask.h | |
31 | @@ -28,7 +28,7 @@ typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; | |
32 | extern int nr_cpu_ids; | |
33 | #endif | |
34 | ||
35 | -#ifdef CONFIG_CPUMASK_OFFSTACK | |
36 | +#if defined(CONFIG_CPUMASK_OFFSTACK) || defined(CONFIG_PREEMPT_RT_BASE) | |
37 | /* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, | |
38 | * not all bits may be allocated. */ | |
39 | #define nr_cpumask_bits nr_cpu_ids |