lkml.org 
[lkml]   [2004]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Limit number of concurrent hotplug processes
Hannes Reinecke <hare@suse.de> wrote:
>
> the attached patch limits the number of concurrent hotplug processes.
> Main idea behind it is that currently each call to call_usermodehelper
> will result in an execve() of "/sbin/hotplug", without any check whether
> enough resources are available for successful execution. This leads to
> hotplug being stuck and in worst cases to machines being unable to boot.
>
> This check cannot be implemented in userspace as the resources are
> already taken by the time any resource check can be done; for the same
> reason any 'slim' programs as /sbin/hotplug will only delay the problem.

hm, it's a bit sad that this happens. Are you able to tell us more about
what is causing such an explosion of module probes?

> Any comments/suggestions welcome; otherwise please apply.

I suggest you just use a semaphore, initialised to a suitable value:


static struct semaphore foo = __SEMAPHORE_INITIALIZER(foo, 50);


{
...
down(&foo);
...
up(&foo);
...
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.091 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site