1. 06 12月, 2013 1 次提交
    • S
      aio: make aio_poll(ctx, true) block with no fds · d3fa9230
      Stefan Hajnoczi 提交于
      This patch drops a special case where aio_poll(ctx, true) returns false
      instead of blocking if no file descriptors are waiting on I/O.  Now it
      is possible to block in aio_poll() to wait for aio_notify().
      
      This change eliminates busy waiting.  bdrv_drain_all() used to rely on
      busy waiting to completed throttled I/O requests but this is no longer
      required so we can simplify aio_poll().
      
      Note that aio_poll() still returns false when aio_notify() was used.  In
      other words, stopping a blocking aio_poll() wait is not considered
      making progress.
      
      Adjust test-aio /aio/bh/callback-delete/one which assumed aio_poll(ctx,
      true) would immediately return false instead of blocking.
      Reviewed-by: NAlex Bligh <alex@alex.org.uk>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      d3fa9230
  2. 23 8月, 2013 1 次提交
  3. 19 8月, 2013 2 次提交
    • S
      aio: drop io_flush argument · f2e5dca4
      Stefan Hajnoczi 提交于
      The .io_flush() handler no longer exists and has no users.  Drop the
      io_flush argument to aio_set_fd_handler() and related functions.
      
      The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no
      longer used and are dropped too.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      f2e5dca4
    • S
      aio: stop using .io_flush() · 164a101f
      Stefan Hajnoczi 提交于
      Now that aio_poll() users check their termination condition themselves,
      it is no longer necessary to call .io_flush() handlers.
      
      The behavior of aio_poll() changes as follows:
      
      1. .io_flush() is no longer invoked and file descriptors are *always*
      monitored.  Previously returning 0 from .io_flush() would skip this file
      descriptor.
      
      Due to this change it is essential to check that requests are pending
      before calling qemu_aio_wait().  Failure to do so means we block, for
      example, waiting for an idle iSCSI socket to become readable when there
      are no requests.  Currently all qemu_aio_wait()/aio_poll() callers check
      before calling.
      
      2. aio_poll() now returns true if progress was made (BH or fd handlers
      executed) and false otherwise.  Previously it would return true whenever
      'busy', which means that .io_flush() returned true.  The 'busy' concept
      no longer exists so just progress is returned.
      
      Due to this change we need to update tests/test-aio.c which asserts
      aio_poll() return values.  Note that QEMU doesn't actually rely on these
      return values so only tests/test-aio.c cares.
      
      Note that ctx->notifier, the EventNotifier fd used for aio_notify(), is
      now handled as a special case.  This is a little ugly but maintains
      aio_poll() semantics, i.e. aio_notify() does not count as 'progress' and
      aio_poll() avoids blocking when the user has not set any fd handlers yet.
      
      Patches after this remove .io_flush() handler code until we can finally
      drop the io_flush arguments to aio_set_fd_handler() and friends.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      164a101f
  4. 22 2月, 2013 3 次提交
  5. 17 1月, 2013 1 次提交
    • K
      aio: Fix return value of aio_poll() · 2ea9b58f
      Kevin Wolf 提交于
      aio_poll() must return true if any work is still pending, even if it
      didn't make progress, so that bdrv_drain_all() doesn't stop waiting too
      early. The possibility of stopping early occasionally lead to a failed
      assertion in bdrv_drain_all(), when some in-flight request was missed
      and the function didn't really drain all requests.
      
      In order to make that change, the return value as specified in the
      function comment must change for blocking = false; fortunately, the
      return value of blocking = false callers is only used in test cases, so
      this change shouldn't cause any trouble.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      2ea9b58f
  6. 19 12月, 2012 2 次提交
  7. 30 10月, 2012 10 次提交
  8. 28 9月, 2012 2 次提交
  9. 19 4月, 2012 3 次提交
  10. 14 1月, 2012 1 次提交
  11. 21 8月, 2011 1 次提交
  12. 21 5月, 2010 1 次提交
  13. 28 10月, 2009 1 次提交
  14. 12 9月, 2009 1 次提交
    • B
      Fix sys-queue.h conflict for good · 72cf2d4f
      Blue Swirl 提交于
      Problem: Our file sys-queue.h is a copy of the BSD file, but there are
      some additions and it's not entirely compatible. Because of that, there have
      been conflicts with system headers on BSD systems. Some hacks have been
      introduced in the commits 15cc9235,
      f40d7537,
      96555a96 and
      3990d09a but the fixes were fragile.
      
      Solution: Avoid the conflict entirely by renaming the functions and the
      file. Revert the previous hacks.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      72cf2d4f
  15. 22 7月, 2009 1 次提交
  16. 15 6月, 2009 1 次提交
  17. 09 5月, 2009 1 次提交
    • A
      AIO deletion race fix · 79d5ca56
      Alexander Graf 提交于
      When deleting an fd event there is a chance the object doesn't get
      deleted, but only ->deleted set positive and deleted somewhere later.
      
      Now, if we create a handler for the fd again before the actual
      deletion occurs, we end up writing data into an object that has
      ->deleted set, which is obviously wrong.
      
      I see two ways to fix this:
      
      1. Don't return ->deleted objects in the search
      2. Unset ->deleted in the search
      
      This patch implements 1. which feels safer to do. It fixes AIO issues
      I've seen with curl, as libcurl unsets fd event listeners pretty
      frequently.
      Signed-off-by: NAlexander Graf <alex@csgraf.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      79d5ca56
  18. 06 2月, 2009 1 次提交
  19. 13 10月, 2008 1 次提交
  20. 23 9月, 2008 1 次提交
    • A
      Refactor AIO to allow multiple AIO implementations · a76bab49
      aliguori 提交于
      This patch refactors the AIO layer to allow multiple AIO implementations.  It's
      only possible because of the recent signalfd() patch.  
      
      Right now, the AIO infrastructure is pretty specific to the block raw backend.
      For other block devices to implement AIO, the qemu_aio_wait function must
      support registration.  This patch introduces a new function,
      qemu_aio_set_fd_handler, which can be used to register a file descriptor to be
      called back.  qemu_aio_wait() now polls a set of file descriptors registered
      with this function until one becomes readable or writable.
      
      This patch should allow the implementation of alternative AIO backends (via a
      thread pool or linux-aio) and AIO backends in non-traditional block devices
      (like NBD).
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5297 c046a42c-6fe2-441c-8c8c-71466251a162
      a76bab49