qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] e8c81b: libqos: improve event_index test with


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e8c81b: libqos: improve event_index test with timeout
Date: Mon, 29 Sep 2014 10:30:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e8c81b4d8a5a2fd125e559cb02b8a87598419041
      
https://github.com/qemu/qemu/commit/e8c81b4d8a5a2fd125e559cb02b8a87598419041
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-09-29 (Mon, 29 Sep 2014)

  Changed paths:
    M tests/libqos/virtio.c
    M tests/libqos/virtio.h
    M tests/virtio-blk-test.c

  Log Message:
  -----------
  libqos: improve event_index test with timeout

The virtio event_index feature lets the device driver tell the device
how many requests to process before raising the next interrupt.
virtio-blk-test.c tries to verify that the device does not raise an
interrupt unnecessarily.

Unfortunately the test has a race condition.  It spins checking for an
interrupt up to 100 times and then assumes the request has finished.  On
a slow host the I/O request could still be in flight and the test would
fail.

This patch waits for the request to complete, or until a 30-second
timeout is reached.  If an interrupt is raised while waiting the test
fails since the device was not supposed to raise interrupts.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>


  Commit: 70556264a89a268efba1d7e8e341adcdd7881eb4
      
https://github.com/qemu/qemu/commit/70556264a89a268efba1d7e8e341adcdd7881eb4
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-09-29 (Mon, 29 Sep 2014)

  Changed paths:
    M tests/libqos/virtio.c
    M tests/libqos/virtio.h
    M tests/virtio-blk-test.c

  Log Message:
  -----------
  libqos: use microseconds instead of iterations for virtio timeout

Some hosts are slow or overloaded so test execution takes a long time.
Test cases use timeouts to protect against an infinite loop stalling the
test forever (especially important in automated test setups).

Commit 6cd14054b67774cc58a51fca6660cfa1d3c08059 ("libqos virtio:
Increase ISR timeout") increased the clock_step() value in an attempt to
lengthen the virtio interrupt wait timeout, but timeout failures are
still occuring on the Travis automated testing platform.

This is because clock_step() only affects the guest's virtual time.
Virtio requests can be bottlenecked on host disk I/O latency - which
cannot be improved by stepping the clock, so the fix was ineffective.

This patch changes the qvirtio_wait_queue_isr() and
qvirtio_wait_config_isr() timeout mechanism from loop iterations to
microseconds.  This way the test case can specify an absolute 30 second
timeout.  Number of loop iterations is not a reliable timeout mechanism
since the speed depends on many factors including host performance.

Tests should no longer timeout on overloaded Travis instances.

Cc: Marc MarĂ­ <address@hidden>
Reported-by: Peter Maydell <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/ed9114356b58...70556264a89a

reply via email to

[Prev in Thread] Current Thread [Next in Thread]