Skip to contentSkip to conversation

Turn CONFIG_HOTPLUG always on.

PATCH In review Greg Kroah-Hartman 3 participants 8 messages Sep 5, 2012 – Oct 5, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Turn CONFIG_HOTPLUG always on.

From: Greg KH <[email protected]>

The CONFIG_HOTPLUG variable is tough to turn off, and almost all arches default to it on.

If you turn it off, it saves you a big 200 or so bytes, and then starts to cause all sorts of problems as the code paths if the option is disabled is never really tested, and memory segments start to get thrown away that driver authors assume will always be present.

So, as part of trying to get rid of the option entirely, let's just turn the option always on.

Note, to do this properly, I found two duplicate definitions of the option, in the Tile and Xtensa arch files, this patch series removes those duplicates first.

Anyone object to me just taking these three patches through my driver-core tree for 3.7? After this set, I'll start unwinding the places where CONFIG_HOTPLUG is used and remove the parts that are not used anymore now that the option can not be turned off.

thanks,

greg k-h

#1 lore raw

PATCH 1/3 xtensa: remove duplicate CONFIG_HOTPLUG definition

From: Greg KH <[email protected]>

As part of the plan to remove CONFIG_HOTPLUG, it was found that xtensa duplicates this config option for no reason (it's already defined as part of init/Kconfig). This patch removes it from the xtensa-only Kconfig file.

---
 arch/xtensa/Kconfig |   18 ------------------
 1 file changed, 18 deletions(-)
arch/xtensa/Kconfig +0 -18
@@ -172,24 +172,6 @@ config CMDLINE
 
 source "mm/Kconfig"
 
-config HOTPLUG
-	bool "Support for hot-pluggable devices"
-	help
-	  Say Y here if you want to plug devices into your computer while
-	  the system is running, and be able to use them quickly.  In many
-	  cases, the devices can likewise be unplugged at any time too.
-
-	  One well known example of this is PCMCIA- or PC-cards, credit-card
-	  size devices such as network cards, modems or hard drives which are
-	  plugged into slots found on all modern laptop computers.  Another
-	  example, used on modern desktops as well as laptops, is USB.
-
-	  Enable HOTPLUG and build a modular kernel.  Get agent software
-	  (from <http://linux-hotplug.sourceforge.net/>) and install it.
-	  Then your kernel will automatically call out to a user mode "policy
-	  agent" (/sbin/hotplug) to load modules and set up software needed
-	  to use devices as you hotplug them.
-
 source "drivers/pcmcia/Kconfig"
 
 source "drivers/pci/hotplug/Kconfig"
#2 lore raw

PATCH 2/3 tile: remove duplicate CONFIG_HOTPLUG definition

In reply to Greg Kroah-Hartman

From: Greg KH <[email protected]>

As part of the plan to remove CONFIG_HOTPLUG, it was found that tile duplicates this config option for no reason (it's already defined as part of init/Kconfig). This patch removes it from the tile-only Kconfig file.

---
 arch/tile/Kconfig |    8 --------
 1 file changed, 8 deletions(-)
arch/tile/Kconfig +0 -8
@@ -412,14 +412,6 @@ config TILE_USB
 config NEED_BOUNCE_POOL
 	def_bool USB_OHCI_HCD
 
-config HOTPLUG
-	bool "Support for hot-pluggable devices"
-	---help---
-	  Say Y here if you want to plug devices into your computer while
-	  the system is running, and be able to use them quickly.  In many
-	  cases, the devices can likewise be unplugged at any time too.
-	  One well-known example of this is USB.
-
 source "drivers/pci/hotplug/Kconfig"
 
 endmenu
Acked-by on v1 2/3
#3 lore raw

Re: [patch 2/3] tile: remove duplicate CONFIG_HOTPLUG definition

Quoted 6 lines · Greg Kroah-Hartman

From: Greg KH <[email protected]>

As part of the plan to remove CONFIG_HOTPLUG, it was found that tile duplicates this config option for no reason (it's already defined as part of init/Kconfig). This patch removes it from the tile-only Kconfig file.

Quoted 6 lines
---
 arch/tile/Kconfig |    8 --------
 1 file changed, 8 deletions(-)
Signature · 2 lines
Chris Metcalf, Tilera Corp.
http://www.tilera.com
#4 lore raw

PATCH 3/3 CONFIG_HOTPLUG should be always on

In reply to Greg Kroah-Hartman

From: Greg KH <[email protected]>

CONFIG_HOTPLUG is a very old option, back when we had static systems and it was odd that any type of device would be removed or added after the system had started up. It is quite hard to disable it these days, and even if you do, it only saves you about 200 bytes. However, if it is disabled, lots of bugs show up because it is almost never tested if the option is disabled.

This is a step to eventually just remove the option entirely, which will clean up all of the devinit* variable and function pointer options, that everyone (myself include) ends up getting wrong eventually, causing real problems when memory segments are removed yet we don't expect them to be.

Cc Geert Uytterhoeven <[email protected]>
Cc Ralf Baechle <[email protected]>
Cc Bjorn Helgaas <[email protected]>
---
 init/Kconfig |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
init/Kconfig +1 -7
@@ -1201,13 +1201,7 @@ config KALLSYMS_ALL
 	   Say N unless you really need all symbols.
 
 config HOTPLUG
-	bool "Support for hot-pluggable devices" if EXPERT
-	default y
-	help
-	  This option is provided for the case where no hotplug or uevent
-	  capabilities is wanted by the kernel.  You should only consider
-	  disabling this option for embedded systems that do not use modules, a
-	  dynamic /dev tree, or dynamic device discovery.  Just say Y.
+	def_bool y
 
 config PRINTK
 	default y
author
#5 lore raw
In reply to Greg Kroah-Hartman
Quoted 13 lines · Greg Kroah-Hartman

From: Greg KH <[email protected]>

The CONFIG_HOTPLUG variable is tough to turn off, and almost all arches default to it on.

If you turn it off, it saves you a big 200 or so bytes, and then starts to cause all sorts of problems as the code paths if the option is disabled is never really tested, and memory segments start to get thrown away that driver authors assume will always be present.

So, as part of trying to get rid of the option entirely, let's just turn the option always on.

Quoted 8 lines

Note, to do this properly, I found two duplicate definitions of the option, in the Tile and Xtensa arch files, this patch series removes those duplicates first.

Anyone object to me just taking these three patches through my driver-core tree for 3.7? After this set, I'll start unwinding the places where CONFIG_HOTPLUG is used and remove the parts that are not used anymore now that the option can not be turned off.

Given the lack of objection, I've now queued these up for 3.7 and will start unwinding the CONFIG_HOTPLUG mess.

thanks,

greg k-h

#6 lore raw
Quoted 18 lines · On Thu, 6 Sep 2012 13:28:16 -0700 Greg KH <[email protected]> wrote:
Quoted 17 lines · Greg Kroah-Hartman

From: Greg KH <[email protected]>

The CONFIG_HOTPLUG variable is tough to turn off, and almost all arches default to it on.

If you turn it off, it saves you a big 200 or so bytes, and then starts to cause all sorts of problems as the code paths if the option is disabled is never really tested, and memory segments start to get thrown away that driver authors assume will always be present.

So, as part of trying to get rid of the option entirely, let's just turn the option always on.

Note, to do this properly, I found two duplicate definitions of the option, in the Tile and Xtensa arch files, this patch series removes those duplicates first.

Quoted 8 lines
Quoted 4 lines

Anyone object to me just taking these three patches through my driver-core tree for 3.7? After this set, I'll start unwinding the places where CONFIG_HOTPLUG is used and remove the parts that are not used anymore now that the option can not be turned off.

Given the lack of objection, I've now queued these up for 3.7 and will start unwinding the CONFIG_HOTPLUG mess.

I wonder if this has had sufficient consideration.

It isn't just 200 bytes, is it? It's all memory which is marked __devinit* and __devexit* - that's a tremendous amount of stuff. We should quantify it.

It wouldn't surprise me if there are organizations who are using CONFIG_HOTPLUG=n effectively. We regularly bust a gut to save a few bytes and for people who really care about this we're here sending them backwards a lot further than that.

Tim, do you know?

author
#7 lore raw
Quoted 31 lines · Andrew Morton
Quoted 18 lines · On Thu, 6 Sep 2012 13:28:16 -0700 Greg KH <[email protected]> wrote:
Quoted 17 lines · Greg Kroah-Hartman

From: Greg KH <[email protected]>

The CONFIG_HOTPLUG variable is tough to turn off, and almost all arches default to it on.

If you turn it off, it saves you a big 200 or so bytes, and then starts to cause all sorts of problems as the code paths if the option is disabled is never really tested, and memory segments start to get thrown away that driver authors assume will always be present.

So, as part of trying to get rid of the option entirely, let's just turn the option always on.

Note, to do this properly, I found two duplicate definitions of the option, in the Tile and Xtensa arch files, this patch series removes those duplicates first.

Quoted 8 lines
Quoted 4 lines

Anyone object to me just taking these three patches through my driver-core tree for 3.7? After this set, I'll start unwinding the places where CONFIG_HOTPLUG is used and remove the parts that are not used anymore now that the option can not be turned off.

Given the lack of objection, I've now queued these up for 3.7 and will start unwinding the CONFIG_HOTPLUG mess.

I wonder if this has had sufficient consideration.

Quoted 8 lines

It isn't just 200 bytes, is it? It's all memory which is marked __devinit* and __devexit* - that's a tremendous amount of stuff. We should quantify it.

It wouldn't surprise me if there are organizations who are using CONFIG_HOTPLUG=n effectively. We regularly bust a gut to save a few bytes and for people who really care about this we're here sending them backwards a lot further than that.

Given the recent round of patches that I've applied to the tree making it so that CONFIG_HOTPLUG=n actually boots and works, that were needed for the past 6+ kernel versions, I find it very unlikely anyone actually runs a system in this type of configuration, but I would love to hear from someone who does if they are out there.

greg k-h