ARM: Export the CPU logical map to modules
RFC PATCH 1/1 ARM: Export the CPU logical map to modules
It is reasonable for loadable modules to be CPU topology aware (particular examples include cpufreq and cpuidle drivers).
This patch exports __cpu_logical_map, so that modules can use the cpu_logical_map() interface declared in <asm/smp_plat.h>.
---
If anyone has a strong view on whether this should be EXPORT_SYMBOL_GPL(), I don't have a problem with changing that. I'm not sure of the precise etiquette here. Certainly this does not feel like a very "public" interface.
Perhaps we should wrap this in a real function for export to modules, rather than encouraging them to poke the __cpu_logical_map[] array (albeit via a predefined macro).
arch/arm/kernel/setup.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/kernel/setup.c +1 -0
@@ -428,6 +428,7 @@ void cpu_init(void) }int __cpu_logical_map[NR_CPUS ]; +EXPORT_SYMBOL (__cpu_logical_map);void __init smp_setup_processor_id (void ) {
Signature · 1 line
1.7.4.1
RFC PATCH 1/1 ARM: Export the CPU logical map to modules
Hi,
Does anyone have a comment on this?
Cheers
---Dave
Quoted 36 lines · Dave Martin
It is reasonable for loadable modules to be CPU topology aware (particular examples include cpufreq and cpuidle drivers).
This patch exports
__cpu_logical_map, so that modules can use thecpu_logical_map()interface declared in <asm/smp_plat.h>.Signed-off-by Dave Martin <[email protected]>---
If anyone has a strong view on whether this should beEXPORT_SYMBOL_GPL(), I don't have a problem with changing that. I'm not sure of the precise etiquette here. Certainly this does not feel like a very "public" interface.Perhaps we should wrap this in a real function for export to modules, rather than encouraging them to poke the __cpu_logical_map[] array (albeit via a predefined macro).
arch/arm/kernel/setup.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)arch/arm/kernel/setup.c +1
-0@@ -428,6 +428,7 @@ void cpu_init(void) }int __cpu_logical_map[NR_CPUS ]; +EXPORT_SYMBOL (__cpu_logical_map);void __init smp_setup_processor_id (void ) {Signature · 1 line
1.7.4.1
RFC PATCH 1/1 ARM: Export the CPU logical map to modules
Quoted 3 lines · Dave Martin
Hi,
Does anyone have a comment on this?
As you say, I'd be tempted to export some accessor with well defined semantic meaning instead.
Quoted 42 lines
Cheers
---DaveQuoted 36 lines · Dave Martin
It is reasonable for loadable modules to be CPU topology aware (particular examples include cpufreq and cpuidle drivers).
This patch exports
__cpu_logical_map, so that modules can use thecpu_logical_map()interface declared in <asm/smp_plat.h>.Signed-off-by Dave Martin <[email protected]>---
If anyone has a strong view on whether this should beEXPORT_SYMBOL_GPL(), I don't have a problem with changing that. I'm not sure of the precise etiquette here. Certainly this does not feel like a very "public" interface.Perhaps we should wrap this in a real function for export to modules, rather than encouraging them to poke the __cpu_logical_map[] array (albeit via a predefined macro).
arch/arm/kernel/setup.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)arch/arm/kernel/setup.c +1
-0@@ -428,6 +428,7 @@ void cpu_init(void) }int __cpu_logical_map[NR_CPUS ]; +EXPORT_SYMBOL (__cpu_logical_map);void __init smp_setup_processor_id (void ) {Signature · 1 line
1.7.4.1
RFC PATCH 1/1 ARM: Export the CPU logical map to modules
Quoted 8 lines · Nicolas Pitre
Quoted 3 lines · Dave Martin
Hi,
Does anyone have a comment on this?
As you say, I'd be tempted to export some accessor with well defined semantic meaning instead.
I think I agree...
Modules definitely shouldn't easily be able to write cpu_logical_map.
I'll rework something and repost.
Cheers
---Dave
Quoted 45 lines
Quoted 45 lines
Cheers
---DaveQuoted 36 lines · Dave Martin
It is reasonable for loadable modules to be CPU topology aware (particular examples include cpufreq and cpuidle drivers).
This patch exports
__cpu_logical_map, so that modules can use thecpu_logical_map()interface declared in <asm/smp_plat.h>.Signed-off-by Dave Martin <[email protected]>---
If anyone has a strong view on whether this should beEXPORT_SYMBOL_GPL(), I don't have a problem with changing that. I'm not sure of the precise etiquette here. Certainly this does not feel like a very "public" interface.Perhaps we should wrap this in a real function for export to modules, rather than encouraging them to poke the __cpu_logical_map[] array (albeit via a predefined macro).
arch/arm/kernel/setup.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)arch/arm/kernel/setup.c +1
-0@@ -428,6 +428,7 @@ void cpu_init(void) }int __cpu_logical_map[NR_CPUS ]; +EXPORT_SYMBOL (__cpu_logical_map);void __init smp_setup_processor_id (void ) {Signature · 1 line
1.7.4.1