From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar 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 Message-ID: <20110615202338.GD4762@elte.hu> References: <1308156491-18488-1-git-send-email-asias.hejun@gmail.com> <1308156491-18488-5-git-send-email-asias.hejun@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Pekka Enberg , Cyrill Gorcunov , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org To: Asias He Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:56371 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753332Ab1FOUXm (ORCPT ); Wed, 15 Jun 2011 16:23:42 -0400 Content-Disposition: inline In-Reply-To: <1308156491-18488-5-git-send-email-asias.hejun@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: * Asias He wrote: > Signed-off-by: Asias He > --- > 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