Skip to contentSkip to conversation

Switch SIG_IPI to SIGUSR1

PATCH Applied Jan Kiszka 4 participants 4 messages May 9, 2012 – May 14, 2012

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Switch SIG_IPI to SIGUSR1

Use SIGUSR1 unconditionally as SIG_IPI. First, ucontext coroutines tend to corrupt RT signal masks due to a 32-on-64-bit Linux kernel bug. And, second, there appears to be no advantage in using RT signals for VCPU kicking.

---

As people prefer to stick with ucontext, this replaces the backend switch for i386-linux.

Avi, you once committed the RT signal based SIG_IPI version to qemu-kvm. Can you confirm that SIGUSR1 comes with no downside?

This is also stable material.

 main-loop.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
main-loop.h +0 -4
index c06b8bc..dce1cd9 100644
@@ -25,11 +25,7 @@
 #ifndef QEMU_MAIN_LOOP_H
 #define QEMU_MAIN_LOOP_H 1
 
-#ifdef SIGRTMIN
-#define SIG_IPI (SIGRTMIN+4)
-#else
 #define SIG_IPI SIGUSR1
-#endif
 
 /**
  * qemu_init_main_loop: Set up the process so that it can run the main loop.
Signature · 1 line
1.7.3.4
#1 lore raw

Am 10.05.2012 00:14, schrieb Jan Kiszka:

Quoted 7 lines

Use SIGUSR1 unconditionally as SIG_IPI. First, ucontext coroutines tend to corrupt RT signal masks due to a 32-on-64-bit Linux kernel bug. And, second, there appears to be no advantage in using RT signals for VCPU kicking.

---

[...]

Quoted 1 line

This is also stable material.

Please cc qemu-stable then. When omitting that in the original patch submission, stable maintainers won't notice when the patch gets a "Thanks, applied" reply.

/-F

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#2 lore raw
In reply to Jan Kiszka
Quoted 5 lines · Jan Kiszka

Use SIGUSR1 unconditionally as SIG_IPI. First, ucontext coroutines tend to corrupt RT signal masks due to a 32-on-64-bit Linux kernel bug. And, second, there appears to be no advantage in using RT signals for VCPU kicking.

Quoted 9 lines

---

As people prefer to stick with ucontext, this replaces the backend switch for i386-linux.

Avi, you once committed the RT signal based SIG_IPI version to qemu-kvm. Can you confirm that SIGUSR1 comes with no downside?

In fact SIGUSR1 would be better in that real-time signals are queued, so two IPIs are delivered twice with the old SIG_IPI and only once with SIGUSR1.

I have some vague recollection that real time signals are handled faster in the kernel. Even if this is true, it's meaningless with kernel irqchip since signalling is only used heavily with userspace APIC.

Signature · 1 line
error compiling committee.c: too many arguments to function
#3 lore raw
In reply to Jan Kiszka
Quoted 6 lines · Jan Kiszka

Use SIGUSR1 unconditionally as SIG_IPI. First, ucontext coroutines tend to corrupt RT signal masks due to a 32-on-64-bit Linux kernel bug. And, second, there appears to be no advantage in using RT signals for VCPU kicking.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 29 lines

---

As people prefer to stick with ucontext, this replaces the backend switch for i386-linux.

Avi, you once committed the RT signal based SIG_IPI version to qemu-kvm. Can you confirm that SIGUSR1 comes with no downside?

This is also stable material.

  main-loop.h |    4 ----
  1 files changed, 0 insertions(+), 4 deletions(-)
main-loop.h +0 -4
index c06b8bc..dce1cd9 100644
@@ -25,11 +25,7 @@
  #ifndef QEMU_MAIN_LOOP_H
  #define QEMU_MAIN_LOOP_H 1
 
-#ifdef SIGRTMIN
-#define SIG_IPI (SIGRTMIN+4)
-#else
  #define SIG_IPI SIGUSR1
-#endif
 
  /**
   * qemu_init_main_loop: Set up the process so that it can run the main loop.