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

* Re: [PATCH] restore scheduler priority for udev children
  2005-06-26 16:38 [PATCH] restore scheduler priority for udev children Marco d'Itri
@ 2005-06-26 17:13 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2005-06-26 17:13 UTC (permalink / raw)
  To: linux-hotplug

On Sun, Jun 26, 2005 at 06:38:00PM +0200, Marco d'Itri wrote:
> udevd has a nice level of -4, which is inherited by spawned children.

No, the childrens get an explicit level.

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

Old versions of udevd+event scripts started from udevsend had all a
inherited nice level of -5 and therefore this was added. Just set the
values in udevd.h, if you think they should be different:
  #define UDEVD_PRIORITY   -4
  #define UDEV_PRIORITY    -2

Kay


-------------------------------------------------------
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_idt77&alloc_id\x16492&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

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