From: Ingo Molnar <mingo@elte.hu>
To: Asias He <asias.hejun@gmail.com>
Cc: Pekka Enberg <penberg@kernel.org>,
Cyrill Gorcunov <gorcunov@gmail.com>,
Sasha Levin <levinsasha928@gmail.com>,
Prasad Joshi <prasadjoshi124@gmail.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH 5/6] kvm tools: Block SIGALRM for vcpu thread using sig_block() helper
Date: Wed, 15 Jun 2011 22:23:38 +0200 [thread overview]
Message-ID: <20110615202338.GD4762@elte.hu> (raw)
In-Reply-To: <1308156491-18488-5-git-send-email-asias.hejun@gmail.com>
* Asias He <asias.hejun@gmail.com> wrote:
> Signed-off-by: Asias He <asias.hejun@gmail.com>
> ---
> tools/kvm/kvm-cpu.c | 7 ++-----
> 1 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
> index 1fb1c74..782a3b2 100644
> --- a/tools/kvm/kvm-cpu.c
> +++ b/tools/kvm/kvm-cpu.c
> @@ -420,12 +420,8 @@ static void kvm_cpu__handle_coalesced_mmio(struct kvm_cpu *cpu)
>
> int kvm_cpu__start(struct kvm_cpu *cpu)
> {
> - sigset_t sigset;
>
> - sigemptyset(&sigset);
> - sigaddset(&sigset, SIGALRM);
> -
> - pthread_sigmask(SIG_BLOCK, &sigset, NULL);
> + sig_block(SIGALRM);
Is there no way to get a signal delivered to only one thread, instead
of trying to broadcast all threads?
Playing with the blocked mask has a performance disadvantage: the
kernel will iterate through all threads of the thread-group to find
the single one that 'can' receive the SIGALRM. This will be a real
scalability issue with 64 or more vcpus.
Thanks,
Ingo
next prev parent reply other threads:[~2011-06-15 20:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 16:48 [PATCH 1/6] kvm tools: Introduce a helper to block a singal for a thread Asias He
2011-06-15 16:48 ` [PATCH 2/6] kvm tools: Block SIGALRM for both rx and tx thread for virtio net Asias He
2011-06-15 16:48 ` [PATCH 3/6] kvm tools: Block SIGALRM for theadpool thread Asias He
2011-06-15 16:48 ` [PATCH 4/6] kvm tools: Block SIGALRM for ioeventfd thread Asias He
2011-06-15 16:48 ` [PATCH 5/6] kvm tools: Block SIGALRM for vcpu thread using sig_block() helper Asias He
2011-06-15 20:23 ` Ingo Molnar [this message]
2011-06-15 16:48 ` [PATCH 6/6] kvm tools: Introduce a helper to show the blocked signals Asias He
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=20110615202338.GD4762@elte.hu \
--to=mingo@elte.hu \
--cc=asias.hejun@gmail.com \
--cc=gorcunov@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=penberg@kernel.org \
--cc=prasadjoshi124@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox