linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] restore scheduler priority for udev children
@ 2005-06-26 16:38 Marco d'Itri
  2005-06-26 17:13 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Marco d'Itri @ 2005-06-26 16:38 UTC (permalink / raw)
  To: linux-hotplug


[-- Attachment #1.1: Type: text/plain, Size: 333 bytes --]

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.)

-- 
ciao,
Marco

[-- Attachment #1.2: nicepriority --]
[-- Type: text/plain, Size: 483 bytes --]

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);

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-26 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-26 16:38 [PATCH] restore scheduler priority for udev children Marco d'Itri
2005-06-26 17:13 ` Kay Sievers

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).