* [PATCH] kvm tools: Signal only one thread when injecting console interrupts
@ 2011-06-15 21:33 Sasha Levin
2011-06-16 0:31 ` Asias He
0 siblings, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2011-06-15 21:33 UTC (permalink / raw)
To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124, Sasha Levin
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 <mingo@elte.hu>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm tools: Signal only one thread when injecting console interrupts
2011-06-15 21:33 [PATCH] kvm tools: Signal only one thread when injecting console interrupts Sasha Levin
@ 2011-06-16 0:31 ` Asias He
2011-06-16 7:29 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Asias He @ 2011-06-16 0:31 UTC (permalink / raw)
To: Sasha Levin; +Cc: penberg, mingo, gorcunov, prasadjoshi124, kvm
On 06/16/2011 05:33 AM, Sasha Levin wrote:
> 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 <mingo@elte.hu>
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
This one is much simpler than the sig_block patches and also resolves
the getaddrinfo() problem for me in virtio net thread.
Tested-by: Asias He <asias.hejun@gmail.com>
--
Best Regards,
Asias He
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm tools: Signal only one thread when injecting console interrupts
2011-06-16 0:31 ` Asias He
@ 2011-06-16 7:29 ` Ingo Molnar
2011-06-24 13:19 ` Asias He
0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2011-06-16 7:29 UTC (permalink / raw)
To: Asias He; +Cc: Sasha Levin, penberg, gorcunov, prasadjoshi124, kvm
* Asias He <asias.hejun@gmail.com> wrote:
> On 06/16/2011 05:33 AM, Sasha Levin wrote:
> > 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 <mingo@elte.hu>
> > Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
>
>
> This one is much simpler than the sig_block patches and also resolves
> the getaddrinfo() problem for me in virtio net thread.
>
> Tested-by: Asias He <asias.hejun@gmail.com>
yep, very nice!
Acked-by: Ingo Molnar <mingo@elte.hu>
Thanks,
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm tools: Signal only one thread when injecting console interrupts
2011-06-16 7:29 ` Ingo Molnar
@ 2011-06-24 13:19 ` Asias He
0 siblings, 0 replies; 4+ messages in thread
From: Asias He @ 2011-06-24 13:19 UTC (permalink / raw)
To: penberg; +Cc: Ingo Molnar, Sasha Levin, gorcunov, prasadjoshi124, kvm
On 06/16/2011 03:29 PM, Ingo Molnar wrote:
> * Asias He <asias.hejun@gmail.com> wrote:
>
>> On 06/16/2011 05:33 AM, Sasha Levin wrote:
>>> 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 <mingo@elte.hu>
>>> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
>>
>>
>> This one is much simpler than the sig_block patches and also resolves
>> the getaddrinfo() problem for me in virtio net thread.
>>
>> Tested-by: Asias He <asias.hejun@gmail.com>
>
> yep, very nice!
>
> Acked-by: Ingo Molnar <mingo@elte.hu>
>
> Thanks,
>
> Ingo
>
Hi, Pekka
Ping. Mind to merge this patch?
--
Best Regards,
Asias He
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-06-24 13:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-15 21:33 [PATCH] kvm tools: Signal only one thread when injecting console interrupts Sasha Levin
2011-06-16 0:31 ` Asias He
2011-06-16 7:29 ` Ingo Molnar
2011-06-24 13:19 ` Asias He
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox