From: Florian Kirstein <xenlist@custom.ray.net>
To: xen-devel@lists.xensource.com
Cc: Ewan Mellor <ewan@xensource.com>
Subject: Re: bug # 477
Date: Thu, 30 Mar 2006 00:39:10 +0200 [thread overview]
Message-ID: <20060330003910.E10946@web.ray.net> (raw)
In-Reply-To: <20060329095603.GC31336@leeni.uk.xensource.com>; from ewan@xensource.com on Wed, Mar 29, 2006 at 10:56:03AM +0100
Hallo,
OK, I found at least a kludge to work around this, see below. Not sure if
it qualifies as a clean soloution, though, but works for me so far...
Added it as a comment in bugzilla, hope that's OK.
> When xenconsoled gets into this state, spinning using 100% CPU, could you use
> gdb to find out where it is spinning? We've not managed to reproduce this
Oh, and I thought it easily reproduces :) But now I even had difficulties
getting it into the "really hung" state, but the "hung for 30 seconds"
was enough for a first analysis:
I used strace to see what xenconsoled is doing while consuming 100% CPU,
and what it does is "select" all the time:
select(20, [16 18 19], [], NULL, NULL) = 1 (in [19])
select(20, [16 18 19], [], NULL, NULL) = 1 (in [19])
select(20, [16 18 19], [], NULL, NULL) = 1 (in [19])
select(20, [16 18 19], [], NULL, NULL) = 1 (in [19])
select(20, [16 18 19], [], NULL, NULL) = 1 (in [19])
select(20, [16 18 19], [], NULL, NULL) = 1 (in [19])
using gdb I identified this to be the select in
tools/console/daemon/io.c line 572 in handle_io(void):
ret = select(max_fd + 1, &readfds, &writefds, 0, NULL);
after which xenconsoled seems to iterate through the domains
to handle the input or something like that.
My idea now was that it could be possible, that the select returns before
the domU really made the data available or something, and then by
running in an select-loop xenconsoled even slows down the machine more
so it takes even longer for the data to become available. Just wild
guesses, I haven't looked into the details of the console code :) So
I simply added:
usleep(100);
after the select in io.c to slow down the select-loop and give the machine
time to do other things. Possibly this is why you can't reproduce it:
because you don't have machines slow enough? :)
The result is satisfying, the console accepts the paste of even large blocks
more or less immediately and I now can't bring xencosoled to consume any
relevant amount of CPU and could not reproduce the soft-irq kernel-message
either. Of course this patch slows down the consoles a bit, but I think
of using even 1000 in the usleep, 1ms should be a fair response time
for a console and it prevents users from stealing Dom0 CPU by flooding
the console :)
Possibly there's a nicer fix for this possible race-condition, but for
that I don't have the insight in the inner workings of the console
mechanism (yet :).
Oh, and for the record: I never could really crash xenconsoled in my
setup (just hang it to 100% CPU), so I'm not sure if this fixes also the
initial problem Alex Kelly had in Bug #477 - possibly he could test this?
(:ul8er, r@y
next prev parent reply other threads:[~2006-03-29 22:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-18 4:00 bug # 477 Jason
2006-03-29 5:24 ` Florian Kirstein
2006-03-29 9:56 ` Ewan Mellor
2006-03-29 22:39 ` Florian Kirstein [this message]
2006-03-30 8:57 ` Keir Fraser
2006-03-30 10:41 ` Keir Fraser
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=20060330003910.E10946@web.ray.net \
--to=xenlist@custom.ray.net \
--cc=ewan@xensource.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.