From mboxrd@z Thu Jan 1 00:00:00 1970 From: md@Linux.IT (Marco d'Itri) Date: Sun, 26 Jun 2005 16:38:00 +0000 Subject: [PATCH] restore scheduler priority for udev children Message-Id: <20050626163800.GA9511@wonderland.linux.it> MIME-Version: 1 Content-Type: multipart/mixed; boundary="wzJLGUyc3ArbnUjN" List-Id: To: linux-hotplug@vger.kernel.org --wzJLGUyc3ArbnUjN Content-Type: multipart/mixed; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable udevd has a nice level of -4, which is inherited by spawned children. This patch restores the usual level of 0, to help mitigating the effects of broken processes which consume all the available CPU. (I don't know the real cause, I'm still investingating it, but the patch looks like a good idea anyway.) --=20 ciao, Marco --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=nicepriority diff -ruNp udev-20050622.orig/udev_utils.c udev-20050622/udev_utils.c --- udev-20050622.orig/udev_utils.c 2005-06-22 13:30:49.000000000 +0200 +++ udev-20050622/udev_utils.c 2005-06-25 14:38:05.000000000 +0200 @@ -401,6 +401,8 @@ int execute_command(const char *command, switch (pid) { case 0: /* child */ + if (setpriority(PRIO_PROCESS, 0, 0) < 0) + err("setpriority failed"); devnull = open("/dev/null", O_RDWR); if (devnull >= 0) { dup2(devnull, STDIN_FILENO); --6TrnltStXW4iwmi0-- --wzJLGUyc3ArbnUjN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCvtnoFGfw2OHuP7ERAny1AJ9pZl7CzScWgrW49YYgwZS6P4LJYACeJp4k dgzd1g6J++4nAOz3zMgHcTY= =jlkR -----END PGP SIGNATURE----- --wzJLGUyc3ArbnUjN-- ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&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