linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: md@Linux.IT (Marco d'Itri)
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] restore scheduler priority for udev children
Date: Sun, 26 Jun 2005 16:38:00 +0000	[thread overview]
Message-ID: <20050626163800.GA9511@wonderland.linux.it> (raw)


[-- 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 --]

             reply	other threads:[~2005-06-26 16:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-26 16:38 Marco d'Itri [this message]
2005-06-26 17:13 ` [PATCH] restore scheduler priority for udev children Kay Sievers

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=20050626163800.GA9511@wonderland.linux.it \
    --to=md@linux.it \
    --cc=linux-hotplug@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).