All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] Throttle consoled to work-around xcs
Date: Thu, 04 Aug 2005 16:14:02 -0500	[thread overview]
Message-ID: <42F2851A.1000406@us.ibm.com> (raw)

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

Instead of queuing messages when the control channels are full, xcs just 
does nothing (see ctrl_interface.c:ctrl_chan_write_request()).

The following patch throttles the rate in which consoled writes data to 
xcs.  With the current values, you get a responsive console but avoid 
data corruption in most scenarios.

I'm able to get pretty far in my regression test with this patch.  With 
higher throttle values I'm able to get even further (but the console 
becomes painfully slow).

I implemented proper control channel queuing in xenctld in VM-Tools and 
it's pretty nasty stuff.  This should prevent corruption for most users 
until we can get rid of xcs.

Regards,

Anthony Liguori

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com

[-- Attachment #2: consoled_throttling.diff --]
[-- Type: text/x-patch, Size: 846 bytes --]

diff -r 60c4cd9ebaa1 tools/consoled/io.c
--- a/tools/consoled/io.c	Wed Aug  3 16:11:32 2005
+++ b/tools/consoled/io.c	Thu Aug  4 16:03:26 2005
@@ -288,6 +288,7 @@
 	fd_set readfds, writefds;
 	int ret;
 	int max_fd = -1;
+	int num_of_writes = 0;
 
 	do {
 		struct domain *d;
@@ -312,6 +313,17 @@
 		}
 
 		ret = select(max_fd + 1, &readfds, &writefds, 0, &tv);
+		if (tv.tv_sec == 1 && (++num_of_writes % 100) == 0) {
+			/* FIXME */
+			/* This is a nasty hack.  xcs does not handle the
+			   control channels filling up well at all.  We'll
+			   throttle ourselves here since we do proper
+			   queueing to give the domains a shot at pulling out
+			   the data.  Fixing xcs is not worth it as it's
+			   going away */
+			tv.tv_usec = 1000;
+			select(0, 0, 0, 0, &tv);
+		}
 		enum_domains();
 
 		if (FD_ISSET(xcs_data_fd, &readfds)) {

[-- 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:[~2005-08-04 21:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=42F2851A.1000406@us.ibm.com \
    --to=aliguori@us.ibm.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.