Re: [PATCH 5/6] kvm tools: Block SIGALRM for vcpu thread using sig_block() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Asias He <asias.hejun@xxxxxxxxx> wrote:

> Signed-off-by: Asias He <asias.hejun@xxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux