[PATCH 0/3] mdev: add daemon mode

Jan Klötzke jan at kloetzke.net
Tue May 7 18:35:29 UTC 2019


On Sat, May 04, 2019 at 07:00:30PM +0200, Markus Gothe wrote:
> Ouch, then fork()'ing is indeed an issue. And Linux not being an RTOS is another issue, but I hope you are using an RTOS (like QNX or FreeRTOS) and not Linux.

Oh, Linux is actually a better match for a full blown IVI system, at
least for the application processor part. You just have to be a bit more
careful when configuring the system. :)

> As pointed out the whole Linux hotplugging system is the real issue here and something like mdevd would be the answer.

It's actually only a problem when you use the naive
/proc/sys/kernel/hotplug approach. Running mdev as daemon solves most of
the issues. And given the small size of the patch I thought it would be
a valuable amendment to busybox. mdevd also looks quite nice but it's
another dependency.

Regards,
Jan

> 
> //M
> 
> Sent from my BlackBerry — the most secure mobile device
> 
> 
> 	  Original Message  
> 
> 
> 
> From: jan at kloetzke.net
> Sent: 4 May 2019 10:49
> To: nietzsche at lysator.liu.se
> Cc: busybox at busybox.net
> Subject: Re: [PATCH 0/3] mdev: add daemon mode
> 
> 
> On Fri, May 03, 2019 at 11:16:34PM +0200, Markus Gothe wrote:
> > Err, zram ofc :)
> ...
> >
> > Or even better you could turn on zswap on your embedded device and avoid the OOM-kiler which I guess is the real reason you fixed this.
> 
> Actually RAM was not the problem at all. It really was the time to spawn
> all the processes and the overhead to serialize them.
> 
> > Actually I want to know when this happens that the kernel creates that many hotplug events; seems like the issue is somewhere else.
> 
> We're building an IVI (In Vehicle Infotainment) system that needs to
> boot really fast. For example we have to show a rear view camera in 2s
> from cold boot. To achive this the kernel is kept very small and most of
> the drivers are loaded as modules when they are actually needed. This
> alone creates so many events that the impact is measurable.
> 
> Regards,
> Jan
> 
> >
> > //M
> >
> > Sent from my BlackBerry — the most secure mobile device
> >
> >
> >   Original Message  
> >
> >
> >
> > From: jan at kloetzke.net
> > Sent: 3 May 2019 23:03
> > To: busybox at busybox.net
> > Subject: [PATCH 0/3] mdev: add daemon mode
> >
> >
> > If mdev is used as kernel hotplug helper and the system generates many
> > hotplug events it will quickly consume considerable resources because a
> > process is forked for each event and, if the mdev.seq feature is used,
> > they must also coordinate among each other. While the uevent applet
> > mitigates some of the resource problems you still have to pay the cost
> > for a fork/exec and parsing of mdev.conf for each event.
> >
> > The following patches add an optional daemon mode to mdev that let's
> > mdev listen on a netlink socket for kernel hotplug events. This mode
> > works much like udev and avoids the fork/exec/parse overhead on many
> > events.
> >
> >
> > _______________________________________________
> > busybox mailing list
> > busybox at busybox.net
> > http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list