From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Date: Tue, 27 Jul 2004 09:05:04 +0000 Subject: Re: [PATCH] Limit number of concurrent hotplug processes Message-Id: <41061AC0.8000607@suse.de> List-Id: References: <40FD23A8.6090409@suse.de> <20040725182006.6c6a36df.akpm@osdl.org> <4104E421.8080700@suse.de> <20040726131807.47816576.akpm@osdl.org> <4105FE68.7040506@suse.de> <20040727002409.68d49d7c.akpm@osdl.org> <41060B62.1060806@suse.de> <20040727013427.52d3e5f5.akpm@osdl.org> In-Reply-To: <20040727013427.52d3e5f5.akpm@osdl.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Andrew Morton Cc: linux-hotplug-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Andrew Morton wrote: > Hannes Reinecke wrote: >=20 >> Patch (for the semaphore version) is attached. >=20 >=20 > err, what on earth is this patch trying to do? It adds tons more > complexity then I expected to see. Are the async (wait=3D0) semantics for > call_usermodehelper() preserved? >=20 Problem with your patch is that call_usermodehelper might block on=20 down() regardless whether it is called async or sync. So any write to sysfs which triggers a hotplug event might block until=20 enough resources are available. Most complexity is in fact due to the possibility to change khelper_max=20 on the fly. If we disallow that everything else will be far cleaner. > Why is the code now doing >=20 > if (stored_info.wait > 0) { > and > if (stored_info.wait >=3D 0) { >=20 > ? `wait' is a boolean. Or did its semantics get secretly changed somewh= ere? >=20 > Why is a new kernel thread needed to up and down a semaphore? >=20 As I said; down() might block. Unless we accept that the caller will=20 only return after all down()s have been executed successfully we need=20 something like that. > Sorry, but I've completely lost the plot on what you're trying to do here! >=20 Sorry for this. I've probably pushed too hard for this. I'll wrap up a patch which only allows for a static setting (via kernel=20 command line parameters) and leave the on-the-fly setting for later :-). >=20 > I'd have though that something like the below (untested, slightly hacky) > patch would suit. >=20 Indeed, but only if we accept that any call to call_usermodehelper might=20 block if not enough resources are available. THX for the patch, btw. Cheers, Hannes --=20 Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstra=DFe 5 +49 911 74053 688 90409 N=FCrnberg http://www.suse.de ------------------------------------------------------- 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=10040&op=CCk _______________________________________________ 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