Skip to contentSkip to conversation

unexport register_cpu and unregister_cpu

PATCH In review Nathan Lynch 2 participants 4 messages Jan 26, 2005 – Jan 27, 2005 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 unexport register_cpu and unregister_cpu

http://linus.bkbits.net:8080/linux-2.5/cset@4180a2b7mi2fzuNQDBOQY7eMAkns8g?nav=index.html|src/|src/drivers|src/drivers/base|related/drivers/base/cpu.c

This changeset introduced exports for register_cpu and unregister_cpu right after 2.6.10. As far as I can tell these are not called from any code which can be built as a module, and I can't think of a good reason why any out of tree code would use them. Unless I've missed something, can we remove them before 2.6.11?

Build-tested for ia64 and i386.

drivers/base/cpu.c +0 -4
Index: linux-2.6.11-rc2-mm1/drivers/base/cpu.c
===================================================================
@@ -64,7 +64,6 @@
 
 	return;
 }
-EXPORT_SYMBOL(unregister_cpu);
 #else /* ... !CONFIG_HOTPLUG_CPU */
 static inline void register_cpu_control(struct cpu *cpu)
 {
@@ -96,9 +95,6 @@
 		register_cpu_control(cpu);
 	return error;
 }
-#ifdef CONFIG_HOTPLUG_CPU
-EXPORT_SYMBOL(register_cpu);
-#endif
 
 
 
#1 lore raw
Quoted 7 lines · Nathan Lynch

http://linus.bkbits.net:8080/linux-2.5/cset@4180a2b7mi2fzuNQDBOQY7eMAkns8g?nav=index.html|src/|src/drivers|src/drivers/base|related/drivers/base/cpu.c

This changeset introduced exports for register_cpu and unregister_cpu right after 2.6.10. As far as I can tell these are not called from any code which can be built as a module, and I can't think of a good reason why any out of tree code would use them. Unless I've missed something, can we remove them before 2.6.11?

No this is not correct. ACPI processor.ko driver which supports
physical CPU hotplug needs register_cpu() and unregister_cpu() functions for dynamically hotadd/hotremove support of the processors.

Please see drivers/acpi/processor_core.c

	acpi_processor_hotadd_init() -> arch_register_cpu() ->
		->register_cpu().

-Anil

#2 lore raw
Quoted 9 lines · Keshavamurthy Anil S
Quoted 7 lines · Nathan Lynch

http://linus.bkbits.net:8080/linux-2.5/cset@4180a2b7mi2fzuNQDBOQY7eMAkns8g?nav=index.html|src/|src/drivers|src/drivers/base|related/drivers/base/cpu.c

This changeset introduced exports for register_cpu and unregister_cpu right after 2.6.10. As far as I can tell these are not called from any code which can be built as a module, and I can't think of a good reason why any out of tree code would use them. Unless I've missed something, can we remove them before 2.6.11?

Quoted 3 lines

No this is not correct. ACPI processor.ko driver which supports
physical CPU hotplug needs register_cpu() and unregister_cpu() functions for dynamically hotadd/hotremove support of the processors.

I do not understand your objection. The processor module does not call the interfaces in question directly. They are called only from arch setup code (e.g. arch/ia64/kernel/topology.c) which is never built as a module.

Quoted 3 lines

Please see drivers/acpi/processor_core.c

	acpi_processor_hotadd_init() -> arch_register_cpu() ->
		->register_cpu().

Sure -- the arch_register_cpu and arch_unregister_cpu symbols need to be exported for this use (and they are). Exporting register_cpu and unregister_cpu is unnecessary.

I double-checked an ia64 build with CONFIG_ACPI_HOTPLUG_CPU=y and CONFIG_ACPI_PROCESSOR=m and saw no errors or warnings caused by the change...

Nathan

#3 lore raw
Quoted 10 lines · Nathan Lynch
Quoted 9 lines · Keshavamurthy Anil S
Quoted 7 lines · Nathan Lynch

http://linus.bkbits.net:8080/linux-2.5/cset@4180a2b7mi2fzuNQDBOQY7eMAkns8g?nav=index.html|src/|src/drivers|src/drivers/base|related/drivers/base/cpu.c

This changeset introduced exports for register_cpu and unregister_cpu right after 2.6.10. As far as I can tell these are not called from any code which can be built as a module, and I can't think of a good reason why any out of tree code would use them. Unless I've missed something, can we remove them before 2.6.11?

Quoted 8 lines
Quoted 3 lines

No this is not correct. ACPI processor.ko driver which supports
physical CPU hotplug needs register_cpu() and unregister_cpu() functions for dynamically hotadd/hotremove support of the processors.

I do not understand your objection. The processor module does not call the interfaces in question directly. They are called only from arch setup code (e.g. arch/ia64/kernel/topology.c) which is never built as a module.

Oops.. Sorry, its my fault.

Quoted 8 lines
Quoted 4 lines

Please see drivers/acpi/processor_core.c

	acpi_processor_hotadd_init() -> arch_register_cpu() ->
		->register_cpu().

Sure -- the arch_register_cpu and arch_unregister_cpu symbols need to be exported for this use (and they are). Exporting register_cpu and unregister_cpu is unnecessary.

I agree with you 100%.

Quoted 4 lines

I double-checked an ia64 build with CONFIG_ACPI_HOTPLUG_CPU=y and CONFIG_ACPI_PROCESSOR=m and saw no errors or warnings caused by the change...

Andrew, I have no objection with Nathan's patch.

thanks,
Anil