qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] d7be5d: aio-posix: fix concurrent access to p


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] d7be5d: aio-posix: fix concurrent access to poll_disable_c...
Date: Fri, 28 Sep 2018 06:14:23 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d7be5dd19c0df7f76e1b42f0c2cbbabefa1974cb
      
https://github.com/qemu/qemu/commit/d7be5dd19c0df7f76e1b42f0c2cbbabefa1974cb
  Author: Paolo Bonzini <address@hidden>
  Date:   2018-09-26 (Wed, 26 Sep 2018)

  Changed paths:
    M util/aio-posix.c

  Log Message:
  -----------
  aio-posix: fix concurrent access to poll_disable_cnt

It is valid for an aio_set_fd_handler to happen concurrently with
aio_poll.  In that case, poll_disable_cnt can change under the heels
of aio_poll, and the assertion on poll_disable_cnt can fail in
run_poll_handlers.

Therefore, this patch simply checks the counter on every polling
iteration.  There are no particular needs for ordering, since the
polling loop is terminated anyway by aio_notify at the end of
aio_set_fd_handler.

Signed-off-by: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>


  Commit: e30cffa04d52e35996569f1cfac111be19576bde
      
https://github.com/qemu/qemu/commit/e30cffa04d52e35996569f1cfac111be19576bde
  Author: Paolo Bonzini <address@hidden>
  Date:   2018-09-26 (Wed, 26 Sep 2018)

  Changed paths:
    M util/aio-posix.c
    M util/trace-events

  Log Message:
  -----------
  aio-posix: compute timeout before polling

This is a preparation for the next patch, and also a very small
optimization.  Compute the timeout only once, before invoking
try_poll_mode, and adjust it in run_poll_handlers.  The adjustment
is the polling time when polling fails, or zero (non-blocking) if
polling succeeds.

Fixes: 70232b5253a3c4e03ed1ac47ef9246a8ac66c6fa
Signed-off-by: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>


  Commit: cfeb35d6774b2e936046aa9923217818bd160299
      
https://github.com/qemu/qemu/commit/cfeb35d6774b2e936046aa9923217818bd160299
  Author: Paolo Bonzini <address@hidden>
  Date:   2018-09-26 (Wed, 26 Sep 2018)

  Changed paths:
    M util/aio-posix.c

  Log Message:
  -----------
  aio-posix: do skip system call if ctx->notifier polling succeeds

Commit 70232b5253 ("aio-posix: Don't count ctx->notifier as progress when
2018-08-15), by not reporting progress, causes aio_poll to execute the
system call when polling succeeds because of ctx->notifier.  This introduces
latency before the call to aio_bh_poll() and negates the advantages of
polling, unfortunately.

The fix builds on the previous patch, separating the effect of polling on
the timeout from the progress reported to aio_poll().  ctx->notifier
does zero the timeout, causing the caller to skip the system call,
but it does not report progress, so that the bug fix of commit 70232b5253
still stands.

Fixes: 70232b5253a3c4e03ed1ac47ef9246a8ac66c6fa
Signed-off-by: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>


  Commit: b33bd859d12e70757bb2632573c3a1662d967dbf
      
https://github.com/qemu/qemu/commit/b33bd859d12e70757bb2632573c3a1662d967dbf
  Author: Peter Maydell <address@hidden>
  Date:   2018-09-26 (Wed, 26 Sep 2018)

  Changed paths:
    M tests/vm/basevm.py

  Log Message:
  -----------
  tests/vm: Use -cpu max rather than -cpu host

-cpu max works with any accelerator, so we don't need
to use it only conditionally if not using KVM. Just use
it all the time.

Signed-off-by: Peter Maydell <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>


  Commit: 51b3c6b73acae1e3fd3c7d441fc86dd17356695f
      
https://github.com/qemu/qemu/commit/51b3c6b73acae1e3fd3c7d441fc86dd17356695f
  Author: yuchenlin <address@hidden>
  Date:   2018-09-26 (Wed, 26 Sep 2018)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: align end of file to a sector boundary

There is a rare case which the size of last compressed cluster
is larger than the cluster size, which will cause the file is
not aligned at the sector boundary.

There are three reasons to do it. First, if vmdk doesn't align at
the sector boundary, there may be many undefined behaviors,
such as, in vbox it will show VMDK: Compressed image is corrupted
'syno-vm-disk1.vmdk' (VERR_ZIP_CORRUPTED) when we try to import an
ova with unaligned vmdk. Second, all the cluster_sector is aligned
to sector, the last one should be like this, too. Third, it ease
reading with sector based I/Os.

Signed-off-by: yuchenlin <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>


  Commit: 099bea113ffba7380b45f174eb54d45d4b801ef2
      
https://github.com/qemu/qemu/commit/099bea113ffba7380b45f174eb54d45d4b801ef2
  Author: Peter Maydell <address@hidden>
  Date:   2018-09-28 (Fri, 28 Sep 2018)

  Changed paths:
    M block/vmdk.c
    M tests/vm/basevm.py
    M util/aio-posix.c
    M util/trace-events

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/famz/tags/staging-pull-request' into 
staging

Block and testing patches

- Paolo's AIO fixes.
- VMDK streamOptimized corner case fix
- VM testing improvment on -cpu

# gpg: Signature made Wed 26 Sep 2018 03:54:08 BST
# gpg:                using RSA key CA35624C6A9171C6
# gpg: Good signature from "Fam Zheng <address@hidden>"
# Primary key fingerprint: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6

* remotes/famz/tags/staging-pull-request:
  vmdk: align end of file to a sector boundary
  tests/vm: Use -cpu max rather than -cpu host
  aio-posix: do skip system call if ctx->notifier polling succeeds
  aio-posix: compute timeout before polling
  aio-posix: fix concurrent access to poll_disable_cnt

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


Compare: https://github.com/qemu/qemu/compare/aa8e26de9617...099bea113ffb
      **NOTE:** This service has been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

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