Thread (4 messages) 4 messages, 3 authors, 2011-06-24
STALE5514d

[PATCH] kvm tools: Signal only one thread when injecting console interrupts

From: Sasha Levin <hidden>
Date: 2011-06-15 21:38:14
Subsystem: kernel virtual machine (kvm), the rest · Maintainers: Paolo Bonzini, Linus Torvalds

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.

Suggested-by: Ingo Molnar <redacted>
Signed-off-by: Sasha Levin <redacted>
---
 tools/kvm/kvm.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
index 2c56a79..22871db 100644
--- a/tools/kvm/kvm.c
+++ b/tools/kvm/kvm.c
@@ -28,6 +28,7 @@
 #include <fcntl.h>
 #include <time.h>
 #include <sys/eventfd.h>
+#include <asm/unistd.h>
 
 #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()");
-- 
1.7.5.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help