1. 19 4月, 2012 2 次提交
  2. 14 1月, 2012 1 次提交
  3. 15 12月, 2011 1 次提交
  4. 14 12月, 2011 1 次提交
  5. 12 11月, 2011 1 次提交
  6. 20 9月, 2011 2 次提交
  7. 23 8月, 2011 1 次提交
    • A
      posix-aio-compat: fix latency issues · e4ea78ee
      Avi Kivity 提交于
      In certain circumstances, posix-aio-compat can incur a lot of latency:
       - threads are created by vcpu threads, so if vcpu affinity is set,
         aio threads inherit vcpu affinity.  This can cause many aio threads
         to compete for one cpu.
       - we can create up to max_threads (64) aio threads in one go; since a
         pthread_create can take around 30μs, we have up to 2ms of cpu time
         under a global lock.
      
      Fix by:
       - moving thread creation to the main thread, so we inherit the main
         thread's affinity instead of the vcpu thread's affinity.
       - if a thread is currently being created, and we need to create yet
         another thread, let thread being born create the new thread, reducing
         the amount of time we spend under the main thread.
       - drop the local lock while creating a thread (we may still hold the
         global mutex, though)
      
      Note this doesn't eliminate latency completely; scheduler artifacts or
      lack of host cpu resources can still cause it.  We may want pre-allocated
      threads when this cannot be tolerated.
      
      Thanks to Uli Obergfell of Red Hat for his excellent analysis and suggestions.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e4ea78ee
  8. 21 8月, 2011 1 次提交
  9. 02 8月, 2011 2 次提交
    • K
      posix-aio-compat: Allow read after EOF · ba1d1afd
      Kevin Wolf 提交于
      In order to be able to transparently replace bdrv_read calls by bdrv_co_read,
      reading beyond EOF must produce zeros instead of short reads for AIO, too.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      ba1d1afd
    • K
      async: Remove AsyncContext · 384acbf4
      Kevin Wolf 提交于
      The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancy
      during an emulated bdrv_read/write (which includes a qemu_aio_wait() call and
      can run AIO callbacks of different requests if it weren't for AsyncContexts).
      
      Now both qcow and qcow2 are protected by CoMutexes and AsyncContexts can be
      removed.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      384acbf4
  10. 08 6月, 2011 1 次提交
  11. 18 5月, 2011 1 次提交
    • K
      posix-aio-compat: Fix idle_threads counter · 5be4aab7
      Kevin Wolf 提交于
      A thread should only be counted as idle when it really is waiting for new
      requests. Without this patch, sometimes too few threads are started as busy
      threads are counted as idle.
      
      Not sure if it makes a difference in practice outside some artificial
      qemu-io/qemu-img tests, but I think the change makes sense in any case.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5be4aab7
  12. 07 3月, 2011 1 次提交
  13. 30 10月, 2010 1 次提交
  14. 06 10月, 2010 1 次提交
  15. 21 9月, 2010 1 次提交
  16. 10 9月, 2010 1 次提交
  17. 31 8月, 2010 1 次提交
  18. 28 5月, 2010 1 次提交
  19. 27 1月, 2010 1 次提交
  20. 04 12月, 2009 2 次提交
  21. 30 10月, 2009 1 次提交
  22. 28 10月, 2009 3 次提交
  23. 27 9月, 2009 1 次提交
  24. 12 9月, 2009 2 次提交
  25. 11 9月, 2009 1 次提交
  26. 28 8月, 2009 1 次提交
    • C
      raw-posix: refactor AIO support · 9ef91a67
      Christoph Hellwig 提交于
      Currently the raw-posix.c code contains a lot of knowledge about the
      asynchronous I/O scheme that is mostly implemented in posix-aio-compat.c.
      All this code does not really belong here and is getting a bit in the
      way of implementing native AIO on Linux.
      
      So instead move all the guts of the AIO implementation into
      posix-aio-compat.c (which might need a better name, btw).
      
      There's now a very small interface between the AIO providers and raw-posix.c:
      
       - an init routine is called from raw_open_common to return an AIO context
         for this drive.  An AIO implementation may either re-use one context
         for all drives, or use a different one for each as the Linux native
         AIO support will do.
       - an submit routine is called from the aio_reav/writev methods to submit
         an AIO request
      
      There are no indirect calls involved in this interface as we need to
      decide which one to call manually.  We will only call the Linux AIO native
      init function if we were requested to by vl.c, and we will only call
      the native submit function if we are asked to and the request is properly
      aligned.  That's also the reason why the alignment check actually does
      the inverse move and now goes into raw-posix.c.
      
      The old posix-aio-compat.h headers is removed now that most of it's
      content is private to posix-aio-compat.c, and instead we add a new
      block/raw-posix-aio.h headers is created containing only the tiny interface
      between raw-posix.c and the AIO implementation.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      9ef91a67
  27. 28 7月, 2009 1 次提交
  28. 09 5月, 2009 1 次提交
  29. 08 4月, 2009 2 次提交
  30. 29 3月, 2009 1 次提交
    • A
      new scsi-generic abstraction, use SG_IO (Christoph Hellwig) · 221f715d
      aliguori 提交于
      Okay, I started looking into how to handle scsi-generic I/O in the
      new world order.
      
      I think the best is to use the SG_IO ioctl instead of the read/write
      interface as that allows us to support scsi passthrough on disk/cdrom
      devices, too.  See Hannes patch on the kvm list from August for an
      example.
      
      Now that we always do ioctls we don't need another abstraction than
      bdrv_ioctl for the synchronous requests for now, and for asynchronous
      requests I've added a aio_ioctl abstraction keeping it simple.
      
      Long-term we might want to move the ops to a higher-level abstraction
      and let the low-level code fill out the request header, but I'm lazy
      enough to leave that to the people trying to support scsi-passthrough
      on a non-Linux OS.
      
      Tested lightly by issuing various sg_ commands from sg3-utils in a guest
      to a host CDROM device.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6895 c046a42c-6fe2-441c-8c8c-71466251a162
      221f715d
  31. 21 2月, 2009 2 次提交