Skip to contentSkip to conversation

Kick io-thread on qemu_chr_accept_input

PATCH In review Jan Kiszka 2 participants 4 messages Mar 16, 2012 – Mar 29, 2012

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Kick io-thread on qemu_chr_accept_input

Once a chr frontend is able to receive input again, we need to inform the io-thread about this fact. Otherwise, main_loop_wait may continue to select without the related backend file descriptor in its set. This can cause high input latencies if only low-rate events arrive otherwise.

---

/me wonders if a similar issue explains the slirp slowness under KVM with in-kernel irqchip enabled. Need to check...

 qemu-char.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
qemu-char.c +1 -0
index 9a5be75..a589a84 100644
@@ -177,6 +177,7 @@ void qemu_chr_accept_input(CharDriverState *s)
 {
     if (s->chr_accept_input)
         s->chr_accept_input(s);
+    qemu_notify_event();
 }
 
 void qemu_chr_fe_printf(CharDriverState *s, const char *fmt, ...)
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 6 lines · Jan Kiszka

Once a chr frontend is able to receive input again, we need to inform the io-thread about this fact. Otherwise, main_loop_wait may continue to select without the related backend file descriptor in its set. This can cause high input latencies if only low-rate events arrive otherwise.

I'm not nacking this patch, but please note that this is a band-aid as not all char devices actually use qemu_chr_accept_input().

Regards,

Anthony Liguori

Quoted 20 lines

---

/me wonders if a similar issue explains the slirp slowness under KVM with in-kernel irqchip enabled. Need to check...

  qemu-char.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
qemu-char.c +1 -0
index 9a5be75..a589a84 100644
@@ -177,6 +177,7 @@ void qemu_chr_accept_input(CharDriverState *s)
  {
      if (s->chr_accept_input)
          s->chr_accept_input(s);
+    qemu_notify_event();
  }
 
  void qemu_chr_fe_printf(CharDriverState *s, const char *fmt, ...)
author
#2 lore raw
Quoted 10 lines · Anthony Liguori
Quoted 6 lines · Jan Kiszka

Once a chr frontend is able to receive input again, we need to inform the io-thread about this fact. Otherwise, main_loop_wait may continue to select without the related backend file descriptor in its set. This can cause high input latencies if only low-rate events arrive otherwise.

I'm not nacking this patch, but please note that this is a band-aid as not all char devices actually use qemu_chr_accept_input().

Then they have to be fixed. :)

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
author
#3 lore raw
Quoted 7 lines · Jan Kiszka
Quoted 6 lines · Anthony Liguori
Quoted 5 lines · Jan Kiszka

Once a chr frontend is able to receive input again, we need to inform the io-thread about this fact. Otherwise, main_loop_wait may continue to select without the related backend file descriptor in its set. This can cause high input latencies if only low-rate events arrive otherwise.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

I'm not nacking this patch, but please note that this is a band-aid as not all char devices actually use qemu_chr_accept_input().

Then they have to be fixed. :)

Could you apply the patch in the meantime? It is not band-aid, but a required base to fix such issues.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux