From: Sasha Levin Date: Wed, 15 Jun 2011 21:33:06 +0000 (-0400) Subject: kvm tools: Signal only one thread when injecting console interrupts X-Git-Tag: next-20110824~3^2~205 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f6c26ccc19c270c2494c5d9dc67c1da351e475ca;p=karo-tx-linux.git kvm tools: Signal only one thread when injecting console interrupts Send signals only to the thread which handles console injection instead of the entire process. This prevents every single thread from having to ignore SIGALRM and will help scaling when running large amount of VCPU threads. Tested-by: Asias He Acked-by: Ingo Molnar Suggested-by: Ingo Molnar Signed-off-by: Sasha Levin Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index 8874cf9192b8..c400c70dddb7 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -28,6 +28,7 @@ #include #include #include +#include #define DEFINE_KVM_EXIT_REASON(reason) [reason] = #reason @@ -529,8 +530,9 @@ void kvm__start_timer(struct kvm *kvm) memset(&sev, 0, sizeof(struct sigevent)); sev.sigev_value.sival_int = 0; - sev.sigev_notify = SIGEV_SIGNAL; + sev.sigev_notify = SIGEV_THREAD_ID; sev.sigev_signo = SIGALRM; + sev._sigev_un._tid = syscall(__NR_gettid); if (timer_create(CLOCK_REALTIME, &sev, &kvm->timerid) < 0) die("timer_create()");