diff mbox

linux: don't automatically set uevent_helper with mdev /dev management

Message ID 769563a34e142e85ec4c.1391761259@argentina
State Accepted
Commit 05e2e35715d104e9dd67b4013d9b16a47b8eb3c0
Headers show

Commit Message

Thomas De Schampheleire Feb. 7, 2014, 8:20 a.m. UTC
When mdev /dev management is chosen in the buildroot configuration, the
Linux configuration is updated automatically to set option
CONFIG_UEVENT_HELPER_PATH to "/sbin/mdev". However, the help text of this
option explicitly recommends not setting this option due to large
performance impact during boot (experienced first hand by the reporter ánd
author).

The mdev startup script S10mdev already sets the helper during userspace
boot, which will make sure mdev is working correctly.

Fixes bug #6596: https://bugs.busybox.net/show_bug.cgi?id=6596

Reported-by: Andreas Koop <andreas.koop@zf.com>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
 linux/linux.mk |  2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

Comments

Yann E. MORIN Feb. 7, 2014, 6:11 p.m. UTC | #1
Thomas, All,

On 2014-02-07 09:20 +0100, Thomas De Schampheleire spake thusly:
> When mdev /dev management is chosen in the buildroot configuration, the
> Linux configuration is updated automatically to set option
> CONFIG_UEVENT_HELPER_PATH to "/sbin/mdev". However, the help text of this
> option explicitly recommends not setting this option due to large
> performance impact during boot (experienced first hand by the reporter ánd
> author).
> 
> The mdev startup script S10mdev already sets the helper during userspace
> boot, which will make sure mdev is working correctly.
> 
> Fixes bug #6596: https://bugs.busybox.net/show_bug.cgi?id=6596
> 
> Reported-by: Andreas Koop <andreas.koop@zf.com>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.
Peter Korsgaard Feb. 7, 2014, 8:50 p.m. UTC | #2
>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:

 > When mdev /dev management is chosen in the buildroot configuration, the
 > Linux configuration is updated automatically to set option
 > CONFIG_UEVENT_HELPER_PATH to "/sbin/mdev". However, the help text of this
 > option explicitly recommends not setting this option due to large
 > performance impact during boot (experienced first hand by the reporter ánd
 > author).

 > The mdev startup script S10mdev already sets the helper during userspace
 > boot, which will make sure mdev is working correctly.

 > Fixes bug #6596: https://bugs.busybox.net/show_bug.cgi?id=6596

 > Reported-by: Andreas Koop <andreas.koop@zf.com>
 > Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Hmm, but the the coldplug handling with 'mdev -s' afaik doesn't handle
module or firmware loading, so those features will break from this.

I would be interested in knowing why hotplug is so much slower than
coldplug. Do you have any idea about how many times mdev gets executed
during bootup?
Thomas De Schampheleire Feb. 7, 2014, 9 p.m. UTC | #3
Peter Korsgaard <jacmet@uclibc.org> schreef:
>>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:
>
> > When mdev /dev management is chosen in the buildroot configuration, the
> > Linux configuration is updated automatically to set option
> > CONFIG_UEVENT_HELPER_PATH to "/sbin/mdev". However, the help text of this
> > option explicitly recommends not setting this option due to large
> > performance impact during boot (experienced first hand by the reporter ánd
> > author).
>
> > The mdev startup script S10mdev already sets the helper during userspace
> > boot, which will make sure mdev is working correctly.
>
> > Fixes bug #6596: https://bugs.busybox.net/show_bug.cgi?id=6596
>
> > Reported-by: Andreas Koop <andreas.koop@zf.com>
> > Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
>Hmm, but the the coldplug handling with 'mdev -s' afaik doesn't handle
>module or firmware loading, so those features will break from this.

Isn't this handled by the installation of the hotplug helper from
S10mdev, after which mdev -s is run?
I.e. everything that happened before S10mdev is caught by 'mdev -s'
and everything after is handled by the hotplug helper, right?

>
>I would be interested in knowing why hotplug is so much slower than
>coldplug. Do you have any idea about how many times mdev gets executed
>during bootup?
>

No, I don't know. I do know that on one particular arm-based single
core system, the time to enter userspace increased from 2 seconds to
10 seconds due to this hotplug helper.

Best regards,
Thomas
Peter Korsgaard Feb. 7, 2014, 9:05 p.m. UTC | #4
>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:

Hi,

 >> Hmm, but the the coldplug handling with 'mdev -s' afaik doesn't handle
 >> module or firmware loading, so those features will break from this.

 > Isn't this handled by the installation of the hotplug helper from
 > S10mdev, after which mdev -s is run?

Yes, if the events happen after that line, but not if they happen
before.

 > I.e. everything that happened before S10mdev is caught by 'mdev -s'
 > and everything after is handled by the hotplug helper, right?

No, mdev -s only scans /sys for devices and create the corresponding
device nodes (already done by devtmpfs) and execute whatever commands
you have defined, it afaik doesn't handle module load or firmware requests.


 >> I would be interested in knowing why hotplug is so much slower than
 >> coldplug. Do you have any idea about how many times mdev gets executed
 >> during bootup?
 >> 

 > No, I don't know. I do know that on one particular arm-based single
 > core system, the time to enter userspace increased from 2 seconds to
 > 10 seconds due to this hotplug helper.

Funky. I personally have never used mdev, but that sounds pretty
extreme.
Thomas De Schampheleire Feb. 7, 2014, 9:16 p.m. UTC | #5
Hi Peter,

On Fri, Feb 7, 2014 at 10:05 PM, Peter Korsgaard <jacmet@uclibc.org> wrote:
>>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:
>
> Hi,
>
>  >> Hmm, but the the coldplug handling with 'mdev -s' afaik doesn't handle
>  >> module or firmware loading, so those features will break from this.
>
>  > Isn't this handled by the installation of the hotplug helper from
>  > S10mdev, after which mdev -s is run?
>
> Yes, if the events happen after that line, but not if they happen
> before.
>
>  > I.e. everything that happened before S10mdev is caught by 'mdev -s'
>  > and everything after is handled by the hotplug helper, right?
>
> No, mdev -s only scans /sys for devices and create the corresponding
> device nodes (already done by devtmpfs) and execute whatever commands
> you have defined, it afaik doesn't handle module load or firmware requests.

When you say 'module load', the only relevant consequence of that is
the creation of nodes in /sys that may need corresponding entries in
/dev right? So this is covered by the S10mdev script, as far as I see.
What else would happen in 'module load' that mdev does not cover?

I'm not familiar enough with firmware requests to talk about that.

However, the kernel configuration says: "This should not be used
today, because usual systems create many events at bootup or device
discovery in a very short time frame. One forked process per event can
create so many processes that it creates a high system load, or on
smaller systems it is known to create out-of-memory situations during
bootup."

So then I wonder, how is it supposed to work for module load and
firmware loading if you can't use this option. Or put another way: are
you sure we need to set the uevent_helper_path for that?

>
>
>  >> I would be interested in knowing why hotplug is so much slower than
>  >> coldplug. Do you have any idea about how many times mdev gets executed
>  >> during bootup?
>  >>
>
>  > No, I don't know. I do know that on one particular arm-based single
>  > core system, the time to enter userspace increased from 2 seconds to
>  > 10 seconds due to this hotplug helper.
>
> Funky. I personally have never used mdev, but that sounds pretty
> extreme.

It's a large increase yes, but it's what we measured.
Another system (4-core powerpc) had about 1-2 seconds increase.

Best regards,
Thomas
Peter Korsgaard Feb. 9, 2014, 9:53 p.m. UTC | #6
>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:

 > When mdev /dev management is chosen in the buildroot configuration, the
 > Linux configuration is updated automatically to set option
 > CONFIG_UEVENT_HELPER_PATH to "/sbin/mdev". However, the help text of this
 > option explicitly recommends not setting this option due to large
 > performance impact during boot (experienced first hand by the reporter ánd
 > author).

 > The mdev startup script S10mdev already sets the helper during userspace
 > boot, which will make sure mdev is working correctly.

 > Fixes bug #6596: https://bugs.busybox.net/show_bug.cgi?id=6596

 > Reported-by: Andreas Koop <andreas.koop@zf.com>
 > Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Committed, thanks.
diff mbox

Patch

diff --git a/linux/linux.mk b/linux/linux.mk
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -186,8 +186,6 @@  define LINUX_CONFIGURE_CMDS
 	$(if $(BR2_ROOTFS_DEVICE_CREATION_STATIC),,
 		$(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS,$(@D)/.config)
 		$(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS_MOUNT,$(@D)/.config))
-	$(if $(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),
-		$(call KCONFIG_SET_OPT,CONFIG_UEVENT_HELPER_PATH,\"/sbin/mdev\",$(@D)/.config))
 	$(if $(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_INOTIFY_USER,$(@D)/.config))
 	$(if $(BR2_PACKAGE_KTAP),