From: Andrew Morton <akpm@osdl.org>
To: Hannes Reinecke <hare@suse.de>
Cc: linux-hotplug-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Limit number of concurrent hotplug processes
Date: Tue, 27 Jul 2004 09:28:26 +0000 [thread overview]
Message-ID: <20040727022826.2c95d8ff.akpm@osdl.org> (raw)
In-Reply-To: <41061AC0.8000607@suse.de>
Hannes Reinecke <hare@suse.de> wrote:
>
> Problem with your patch is that call_usermodehelper might block on
> down() regardless whether it is called async or sync.
> So any write to sysfs which triggers a hotplug event might block until
> enough resources are available.
This is exactly the behaviour we want. If we don't block the caller then
the only option is to fail the call_usermodehelper() attempt, which would
be very bad indeed.
The main reason for calling call_usermodehelper(wait=0) is that the caller
holds locks which will prevent the helper application from terminating. I
guess my proto-patch risks the same deadlock, because all the
currently-running helpers may be waiting on that lock.
Maybe this is why you were allocating a copy of the call_usermodehelper()
arguments? I didn't try to reverse-engineer your patch to that extent -
I'd prefer to hear the design in your own words. Am still waiting for
this, btw.
Allocating a whole bunch of buffers to hold copies of the
call_usermodehelper() args also uses resources, of course. But it should
be acceptable. We'd allocate the same amount of memory if we were sending
messages up a socket/pipe to userspace, which is what we should always have
done, instead of the direct-exec - it's caused tons of trouble.
You didn't answer half the questions in my previous email, btw.
Right now, I cannot think of any solution apart from:
- In the sync path, take the semaphore
- In the async path, take a copy of the args, then pass them over to some
kernel thread which takes the args off a list one-at-a-time, takes the
semaphore for each one, execs the helper and drops the semaphore on the
exit path.
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id\x10040&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2004-07-27 9:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-20 13:52 [PATCH] Limit number of concurrent hotplug processes Hannes Reinecke
2004-07-26 1:20 ` Andrew Morton
2004-07-26 6:19 ` Christian Borntraeger
2004-07-26 10:59 ` Hannes Reinecke
2004-07-26 20:18 ` Andrew Morton
2004-07-27 7:04 ` Hannes Reinecke
2004-07-27 7:24 ` Andrew Morton
2004-07-27 7:59 ` Hannes Reinecke
2004-07-27 8:34 ` Andrew Morton
2004-07-27 9:05 ` Hannes Reinecke
2004-07-27 9:28 ` Andrew Morton [this message]
2004-07-27 12:22 ` Hannes Reinecke
2004-07-28 7:12 ` Paul Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040727022826.2c95d8ff.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=hare@suse.de \
--cc=linux-hotplug-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).