Commit 673a500
perf: Fix topology_sibling_cpumask check warning on ARM
The below warning is triggered when building with arm
multi_v7_defconfig.
kernel/events/core.c: In function 'perf_event_setup_cpumask':
kernel/events/core.c:14012:13: warning: the comparison will always evaluate as 'true' for the address of 'thread_sibling' will never be NULL [-Waddress]
14012 | if (!topology_sibling_cpumask(cpu)) {
The perf_event_init_cpu() may be invoked at the early boot stage, while
the topology_*_cpumask hasn't been initialized yet. The check is to
specially handle the case, and initialize the perf_online_<domain>_masks
on the boot CPU.
X86 uses a per-cpu cpumask pointer, which could be NULL at the early
boot stage. However, ARM uses a global variable, which never be NULL.
Use perf_online_mask as an indicator instead. Only initialize the
perf_online_<domain>_masks when perf_online_mask is empty.
Fix a typo as well.
Fixes: 4ba4f1a ("perf: Generic hotplug support for a PMU with a scope")
Reported-by: Stephen Rothwell <[email protected]>
Closes: https://lore.kernel.org/lkml/[email protected]/
Reported-by: Steven Price <[email protected]>
Closes: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Kan Liang <[email protected]>
Tested-by: Steven Price <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>1 parent 8826498 commit 673a500
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14002 | 14002 | | |
14003 | 14003 | | |
14004 | 14004 | | |
14005 | | - | |
14006 | | - | |
14007 | 14005 | | |
14008 | 14006 | | |
14009 | 14007 | | |
14010 | | - | |
| 14008 | + | |
14011 | 14009 | | |
14012 | | - | |
| 14010 | + | |
14013 | 14011 | | |
14014 | 14012 | | |
14015 | 14013 | | |
14016 | 14014 | | |
14017 | 14015 | | |
14018 | 14016 | | |
14019 | | - | |
| 14017 | + | |
14020 | 14018 | | |
14021 | 14019 | | |
14022 | 14020 | | |
| |||
14031 | 14029 | | |
14032 | 14030 | | |
14033 | 14031 | | |
| 14032 | + | |
| 14033 | + | |
14034 | 14034 | | |
14035 | 14035 | | |
14036 | 14036 | | |
| |||
0 commit comments