You are not logged in.

#1 2005-09-18 23:21:46

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Why is hotplug so damn slow?

No, I'm not asking for a solution. This is just a rant.

You see, I've noticed that, even if I modprobe all the modules that hotplug does in my rc.conf, loading the modules still takes only a couple of seconds, while hotplug wallows around for 15 seconds. Seriously, there must be something wrong there... loading modules, even a large number of them, does not take a long time! And neither does probing the hardware to see what modules are needed - just look at lshwd -a, which on my machine loads maybe a little more than 2/3 the number of modules that hotplug does, and takes not one fifth as long. Just how sloppily coded is this daemon?!

[/rant]

Offline

#2 2005-09-18 23:31:57

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Why is hotplug so damn slow?

http://kerneltrap.org/node/4706

lshwd works in a completly different way from hotplug.

Offline

#3 2005-09-19 00:09:28

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Why is hotplug so damn slow?

Yippee! When will hotplug-ng hit the repos? big_smile

Offline

#4 2005-09-19 00:21:15

Lowe
Member
Registered: 2005-07-11
Posts: 89

Re: Why is hotplug so damn slow?

I'm using lshwd seems to work better and faster for me, but i'm sure that's not the case for everyone or heck everyone would be using it.

Offline

#5 2005-09-19 00:33:17

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Why is hotplug so damn slow?

lshwd can only do coldplugging, doesn't work for hotplugging stuff.

Offline

#6 2005-09-19 00:55:01

Lowe
Member
Registered: 2005-07-11
Posts: 89

Re: Why is hotplug so damn slow?

Gullible Jones wrote:

lshwd can only do coldplugging, doesn't work for hotplugging stuff.

Ah, I see. I'm completely clueless about this kinda stuff to be honest, but I don't think i need hotplug or at least I haven't run into anything flakey yet.

Offline

#7 2005-09-19 15:41:35

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Why is hotplug so damn slow?

Gullible Jones wrote:

lshwd can only do coldplugging, doesn't work for hotplugging stuff.

Hotplugging is now more job of pure udev than hotplug scripts (+ loading modules from /etc/rc.conf or you can do it from udev custom rules too).

Any concrete problems ?

Offline

#8 2005-09-19 16:47:36

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Why is hotplug so damn slow?

Gullible Jones wrote:

lshwd can only do coldplugging, doesn't work for hotplugging stuff.

Ugh, this is a tad misinformed.  This seems to confuse alot of people, so I'll make it nice:

hotplug : a set of bash scripts (and a binary?) which are called by udev (or directly by the kernel under devfs) when a device is found.

hotplugging : the act of adding a device while the system is "hot" (on)

coldplugging : the act of adding a device while the system is "cold" (off)

on startup:
--- hotplug : runs to determine all cold-plugged devices in the system.  This is done once, loading the proper modules and then hotplug exits - hotplug down not remain running as a "daemon" like cron or syslog, it does it's job then exits.
--- lshwd : does the exact same thing as hotplug - it looks up coldplugged devices, loads the modules and exits

after startup:
--- hot-plug a device : once a new device is plugged in, the kernel tells udev "there's a new device".  udev inspects some parameters and creates the proper node in the /dev tree.  udev then calls the hotplug scripts, telling it the new node it has created.  once again, hotplug exits once it has done whatever it needs to do

The point is that you do not need to run the hotplug daemon for hotplug to work on your system, as it is not a real "daemon" in the unix sense of the word, only a script executed on boot.  Hotplug itself is a set of scripts called by udev.  As long as udev is running, you can hotplug devices

Offline

#9 2005-09-19 20:44:50

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Why is hotplug so damn slow?

Oh really? Thanks! 8)

I probably didn't figure it out because it doesn't quite work for me... You see, when I turn on my printer (on the parallel port), /dev/lp0 isn't created; that doesn't happen until I load the lp and parport-pc modules.

(Interestingly, DevFS created the node last time I used it. uDev seems to have this thing with parallel port printers...)

BTW, is there a way to make uDev use lshwd for hotplugging?

Offline

#10 2005-09-19 20:55:30

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Why is hotplug so damn slow?

Gullible Jones wrote:

BTW, is there a way to make uDev use lshwd for hotplugging?

It really doesn't work that way.  When actually "hotplugging" something, it's doing much more than matching hardware ids with the proper modules.

Also, the reason your printer didn't work is because you have to load the paraport module before you can hotplug off the parallel port - just like you can't hotplug USB devices if you haven't loaded the ehci-hcd/uhci-hcd/ohci-hcd module.

Offline

#11 2005-09-19 21:42:50

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Why is hotplug so damn slow?

Okay... Thanks.

(So there's no way to use something less pokey than the hotplug scripts? Damn.)

Offline

#12 2005-09-19 22:08:14

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Why is hotplug so damn slow?

Gullible Jones wrote:

Okay... Thanks.

(So there's no way to use something less pokey than the hotplug scripts? Damn.)

When actually hotplugging a device, the scripts perform very well.  I think it's just the illusion because the startup scripts are so slow... but the startups scripts do an assload of stuff... the normal scripts run be udev should be causing any bottle necks... I mean it's at least as fast as it takes Windows XP to popup the little bubble "New Device Found".

Offline

#13 2005-09-19 22:37:53

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Why is hotplug so damn slow?

In that case, is it possible to use hotplug without the coldplugging scripts?

Offline

#14 2005-09-19 23:22:06

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Why is hotplug so damn slow?

Gullible Jones wrote:

In that case, is it possible to use hotplug without the coldplugging scripts?

Yes.  Don't put "hotplug" into your daemons.  Udev automatically calls the hot-plugging hotplug scripts whether you use the coldplug scripts or not.

Offline

#15 2005-09-20 00:03:58

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Why is hotplug so damn slow?

Oh? Because even with the parport module loaded, it still doesn't see my parallel port printer :?

Offline

#16 2005-09-20 00:19:52

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Why is hotplug so damn slow?

Gullible Jones wrote:

Oh? Because even with the parport module loaded, it still doesn't see my parallel port printer :?

Well, the only difference between the hotplug and lshwd "daemons" is they load different modules... so I would think that a module that gets loaded when you use the hotplug coldplug scripts (that sounded wierd) that otherwise doesn't.  Maybe compare your lsmod results before/after issuing /etc/rc.d/hotplug and see if anything catches your eye?

Offline

#17 2005-09-20 01:05:06

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Why is hotplug so damn slow?

I don't use lshwd... And even if I use the hotplug's startup scripts, my printer is not detected.

What the heck, I'll modprobe that stuff manually from rc.conf.

Offline

#18 2005-09-20 10:29:12

rose
Member
Registered: 2005-02-09
Posts: 64

Re: Why is hotplug so damn slow?

Why not compile kernel with all the necessary modules included and get rid of hotplug altogether? I did that, removed ldconfig from boot scripts and the system boots really fast.

Offline

#19 2005-09-20 17:58:30

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Why is hotplug so damn slow?

Because I'd prefer not to have to recompile the kernel again if I switch around some hardware.

Offline

Board footer

Powered by FluxBB