1. 04 1月, 2017 4 次提交
    • S
      aio: add polling mode to AioContext · 4a1cba38
      Stefan Hajnoczi 提交于
      The AioContext event loop uses ppoll(2) or epoll_wait(2) to monitor file
      descriptors or until a timer expires.  In cases like virtqueues, Linux
      AIO, and ThreadPool it is technically possible to wait for events via
      polling (i.e. continuously checking for events without blocking).
      
      Polling can be faster than blocking syscalls because file descriptors,
      the process scheduler, and system calls are bypassed.
      
      The main disadvantage to polling is that it increases CPU utilization.
      In classic polling configuration a full host CPU thread might run at
      100% to respond to events as quickly as possible.  This patch implements
      a timeout so we fall back to blocking syscalls if polling detects no
      activity.  After the timeout no CPU cycles are wasted on polling until
      the next event loop iteration.
      
      The run_poll_handlers_begin() and run_poll_handlers_end() trace events
      are added to aid performance analysis and troubleshooting.  If you need
      to know whether polling mode is being used, trace these events to find
      out.
      
      Note that the AioContext is now re-acquired before disabling notify_me
      in the non-polling case.  This makes the code cleaner since notify_me
      was enabled outside the non-polling AioContext release region.  This
      change is correct since it's safe to keep notify_me enabled longer
      (disabling is an optimization) but potentially causes unnecessary
      event_notifer_set() calls.  I think the chance of performance regression
      is small here.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 20161201192652.9509-4-stefanha@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4a1cba38
    • S
      aio: add AioPollFn and io_poll() interface · f6a51c84
      Stefan Hajnoczi 提交于
      The new AioPollFn io_poll() argument to aio_set_fd_handler() and
      aio_set_event_handler() is used in the next patch.
      
      Keep this code change separate due to the number of files it touches.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 20161201192652.9509-3-stefanha@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      f6a51c84
    • S
      aio: add flag to skip fds to aio_dispatch() · 721671ad
      Stefan Hajnoczi 提交于
      Polling mode will not call ppoll(2)/epoll_wait(2).  Therefore we know
      there are no fds ready and should avoid looping over fd handlers in
      aio_dispatch().
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 20161201192652.9509-2-stefanha@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      721671ad
    • S
      HACKING: document #include order · 0891ee11
      Stefan Hajnoczi 提交于
      It was not obvious to me why "qemu/osdep.h" must be the first #include.
      This documents the rationale and the overall #include order.
      
      Cc: Fam Zheng <famz@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Eric Blake <eblake@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-id: 1479307161-24658-1-git-send-email-stefanha@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0891ee11
  2. 29 12月, 2016 1 次提交
    • P
      Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.9-pull-request' into staging · dbe2b655
      Peter Maydell 提交于
      # gpg: Signature made Tue 27 Dec 2016 17:52:12 GMT
      # gpg:                using RSA key 0xF30C38BD3F2FBE3C
      # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
      # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
      # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
      # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
      
      * remotes/vivier/tags/m68k-for-2.9-pull-request:
        target-m68k: free TCG variables that are not
        target-m68k: add rol/ror/roxl/roxr instructions
        target-m68k: Inline shifts
        target-m68k: Do not cpu_abort on undefined insns
        target-m68k: Implement 680x0 movem
        target-m68k: add cas/cas2 ops
        target-m68k: add abcd/sbcd/nbcd
        target-m68k: add 680x0 divu/divs variants
        target-m68k: add 64bit mull
        target-m68k: add cmpm
        target-m68k: Split gen_lea and gen_ea
        target-m68k: Delay autoinc writeback
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      dbe2b655
  3. 28 12月, 2016 13 次提交
  4. 27 12月, 2016 22 次提交