From: Anthony Liguori <aliguori@linux.vnet.ibm.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org, Chris Wright <chrisw@sous-sol.org>,
Avi Kivity <avi@redhat.com>,
kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)
Date: Tue, 23 Nov 2010 15:46:37 -0600 [thread overview]
Message-ID: <4CEC363D.50206@linux.vnet.ibm.com> (raw)
In-Reply-To: <AANLkTin+Bscmmheo1xURNMY_hPxZ+=PgJRveZj_uB44f@mail.gmail.com>
On 11/23/2010 01:35 PM, Blue Swirl wrote:
> On Tue, Nov 23, 2010 at 4:49 PM, Anthony Liguori<aliguori@us.ibm.com> wrote:
>
>> qemu-kvm vcpu threads don't response to SIGSTOP/SIGCONT. Instead of teaching
>> them to respond to these signals (which cannot be trapped), use SIGUSR1 to
>> approximate the behavior of SIGSTOP/SIGCONT.
>>
>> The purpose of this is to implement CPU hard limits using an external tool that
>> watches the CPU consumption and stops the VCPU as appropriate.
>>
>> This provides a more elegant solution in that it allows the VCPU thread to
>> release qemu_mutex before going to sleep.
>>
>> This current implementation uses a single signal. I think this is too racey
>> in the long term so I think we should introduce a second signal. If two signals
>> get coalesced into one, it could confuse the monitoring tool into giving the
>> VCPU the inverse of it's entitlement.
>>
>> It might be better to simply move this logic entirely into QEMU to make this
>> more robust--the question is whether we think this is a good long term feature
>> to carry in QEMU?
>>
>
>> +static __thread int sigusr1_wfd;
>>
> While OpenBSD finally updated the default compiler to 4.2.1 from 3.x
> series, thread local storage is still not supported:
>
Hrm, is there a portable way to do this (distinguish a signal on a
particular thread)?
Regards,
Anthony Liguori
> $ cat thread.c
> static __thread int sigusr1_wfd;
> $ gcc thread.c -c
> thread.c:1: error: thread-local storage not supported for this target
> $ gcc -v
> Reading specs from /usr/lib/gcc-lib/sparc64-unknown-openbsd4.8/4.2.1/specs
> Target: sparc64-unknown-openbsd4.8
> Configured with: OpenBSD/sparc64 system compiler
> Thread model: posix
> gcc version 4.2.1 20070719
>
next prev parent reply other threads:[~2010-11-23 21:47 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-23 16:49 [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2) Anthony Liguori
2010-11-23 19:35 ` [Qemu-devel] " Blue Swirl
2010-11-23 21:46 ` Anthony Liguori [this message]
2010-11-23 23:43 ` Paolo Bonzini
2010-11-24 1:15 ` Anthony Liguori
2010-11-24 2:08 ` Paolo Bonzini
2010-11-24 8:18 ` Avi Kivity
2010-11-24 13:58 ` Anthony Liguori
2010-11-24 14:23 ` Avi Kivity
2010-12-01 12:37 ` Srivatsa Vaddagiri
2010-12-01 12:56 ` Avi Kivity
2010-12-01 16:12 ` Srivatsa Vaddagiri
2010-12-01 16:25 ` Peter Zijlstra
2010-12-01 17:17 ` Chris Wright
2010-12-01 17:22 ` Peter Zijlstra
2010-12-01 17:26 ` Rik van Riel
2010-12-01 19:07 ` Peter Zijlstra
2010-12-01 19:24 ` Rik van Riel
2010-12-01 19:35 ` Peter Zijlstra
2010-12-01 19:42 ` Rik van Riel
2010-12-01 19:47 ` Peter Zijlstra
2010-12-02 9:07 ` Avi Kivity
2010-12-01 17:46 ` Chris Wright
2010-12-01 17:29 ` Srivatsa Vaddagiri
2010-12-01 17:45 ` Peter Zijlstra
2010-12-01 18:00 ` Srivatsa Vaddagiri
2010-12-01 19:09 ` Peter Zijlstra
2010-12-02 9:17 ` Avi Kivity
2010-12-02 11:47 ` Srivatsa Vaddagiri
2010-12-02 12:22 ` Srivatsa Vaddagiri
2010-12-02 12:41 ` Avi Kivity
2010-12-02 13:13 ` Srivatsa Vaddagiri
2010-12-02 13:49 ` Avi Kivity
2010-12-02 15:27 ` Srivatsa Vaddagiri
2010-12-02 15:28 ` Srivatsa Vaddagiri
2010-12-02 15:33 ` Avi Kivity
2010-12-02 15:44 ` Srivatsa Vaddagiri
2010-12-02 12:19 ` Srivatsa Vaddagiri
2010-12-02 12:42 ` Avi Kivity
2010-12-02 9:14 ` Avi Kivity
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=4CEC363D.50206@linux.vnet.ibm.com \
--to=aliguori@linux.vnet.ibm.com \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=chrisw@sous-sol.org \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.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 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.