All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Byrne <john.l.byrne@hp.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] RHEL3 2.4 domU kernel has load average of 2
Date: Fri, 23 Feb 2007 14:49:23 -0800	[thread overview]
Message-ID: <45DF6F73.4040404@hp.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 439 bytes --]


The backport of the xenbus code for the 2.4 kernel changed
wait_event_interruptible() into wait_event() into a couple of places it
looks to deal with the fact that signals weren't being blocked. This
results in an idle domU showing a load-average of 2, which was messing
up some work-management tools.

The attached patch blocks all signals for the xenbus and xenwatch
daemons, instead.

Signed-off-by: John Byrne <john.l.byrne@hp.com>



[-- Attachment #2: xenjlb.patch --]
[-- Type: text/x-patch, Size: 2015 bytes --]

diff -Nar -U4 linux-2.4.21/drivers/xen/xenbus/xenbus_comms.c linux-2.4.21/drivers/xen/xenbus/xenbus_comms.c
--- linux-2.4.21/drivers/xen/xenbus/xenbus_comms.c	2007-02-23 14:46:17.000000000 -0600
+++ linux-2.4.21/drivers/xen/xenbus/xenbus_comms.c	2007-02-23 14:54:55.000000000 -0600
@@ -149,9 +149,9 @@
 	while (len != 0) {
 		unsigned int avail;
 		const char *src;
 
-		wait_event/*_interruptible*/(xb_waitq,
+		wait_event_interruptible(xb_waitq,
 					 intf->rsp_cons != intf->rsp_prod);
 
 		/* Read indexes, then verify. */
 		cons = intf->rsp_cons;
diff -Nar -U4 linux-2.4.21/drivers/xen/xenbus/xenbus_xs.c linux-2.4.21/drivers/xen/xenbus/xenbus_xs.c
--- linux-2.4.21/drivers/xen/xenbus/xenbus_xs.c	2007-02-23 14:46:17.000000000 -0600
+++ linux-2.4.21/drivers/xen/xenbus/xenbus_xs.c	2007-02-23 14:53:53.000000000 -0600
@@ -45,8 +45,21 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 #include <linux/module.h>
 #include <linux/uio.h>
 #define kvec iovec
+
+static void block_signals(void)
+{
+	sigset_t blocked;
+
+	sigfillset(&blocked);
+	spin_lock_irq(&current->sighand->siglock);
+	current->blocked = blocked;
+	recalc_sigpending();
+	spin_unlock_irq(&current->sighand->siglock);
+	flush_signals(current);
+}
+
 #endif
 
 /* xenbus_probe.c */
 extern char *kasprintf(const char *fmt, ...);
@@ -712,8 +722,9 @@
 	struct xs_stored_msg *msg;
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 	daemonize();
+	block_signals();
 	memcpy(current->comm, "xenwatch", 10);
 #endif
 
 
@@ -724,11 +735,10 @@
 		schedule();
 #endif
 
 	for (;;) {
-		/* XXXAP _interruptable spins here after killall */
-		wait_event(watch_events_waitq,
-			   !list_empty(&watch_events));
+		wait_event_interruptible(watch_events_waitq,
+					 !list_empty(&watch_events));
 
 #if 0				/* XXXAP 2.4 */
 		if (kthread_should_stop())
 			break;
@@ -827,8 +837,9 @@
 	int err;
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 	daemonize();
+	block_signals();
 	memcpy(current->comm, "xenbus", 8);
 #endif
 
 #ifdef CONFIG_HOTPLUG_CPU

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2007-02-23 22:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-23 22:49 John Byrne [this message]
2007-02-26  9:48 ` [PATCH] RHEL3 2.4 domU kernel has load average of 2 Ian Campbell

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=45DF6F73.4040404@hp.com \
    --to=john.l.byrne@hp.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.