qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 1d52cc: virtio-blk: avoid using ioeventfd sta


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 1d52cc: virtio-blk: avoid using ioeventfd state in irqfd c...
Date: Wed, 07 Feb 2024 06:09:15 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 1d52cc0ac27761e296b14655c2f5b2649ee69491
      
https://github.com/qemu/qemu/commit/1d52cc0ac27761e296b14655c2f5b2649ee69491
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: avoid using ioeventfd state in irqfd conditional

Requests that complete in an IOThread use irqfd to notify the guest
while requests that complete in the main loop thread use the traditional
qdev irq code path. The reason for this conditional is that the irq code
path requires the BQL:

  if (s->ioeventfd_started && !s->ioeventfd_disabled) {
      virtio_notify_irqfd(vdev, req->vq);
  } else {
      virtio_notify(vdev, req->vq);
  }

There is a corner case where the conditional invokes the irq code path
instead of the irqfd code path:

  static void virtio_blk_stop_ioeventfd(VirtIODevice *vdev)
  {
      ...
      /*
       * Set ->ioeventfd_started to false before draining so that host notifiers
       * are not detached/attached anymore.
       */
      s->ioeventfd_started = false;

      /* Wait for virtio_blk_dma_restart_bh() and in flight I/O to complete */
      blk_drain(s->conf.conf.blk);

During blk_drain() the conditional produces the wrong result because
ioeventfd_started is false.

Use qemu_in_iothread() instead of checking the ioeventfd state.

Buglink: https://issues.redhat.com/browse/RHEL-15394
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20240122172625.415386-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 5bd5f8c480e1697f83dfd1928382e370fa9e1e26
      
https://github.com/qemu/qemu/commit/5bd5f8c480e1697f83dfd1928382e370fa9e1e26
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-02-07 (Wed, 07 Feb 2024)

  Changed paths:
    M backends/hostmem.c
    M hw/hyperv/hv-balloon.c
    M hw/mem/memory-device.c
    M hw/virtio/virtio-mem.c
    M include/hw/qdev-core.h
    M include/qemu/osdep.h
    M system/vl.c
    M util/oslib-posix.c
    M util/oslib-win32.c

  Log Message:
  -----------
  Merge tag 'mem-2024-02-06-v3' of https://github.com/davidhildenbrand/qemu 
into staging

Hi,

"Host Memory Backends" and "Memory devices" queue ("mem"):
- Reintroduce memory region size checks for memory devices; the removal
  lead to some undesired side effects
- Preallocate memory of memory backends in selected configurations
  asynchronously (so we preallocate concurrently), to speed up QEMU
  startup time.

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEG9nKrXNcTDpGDfzKTd4Q9wD/g1oFAmXB3LcRHGRhdmlkQHJl
# ZGhhdC5jb20ACgkQTd4Q9wD/g1plRA/+N8y4aJB+qEwacl5scIpiWShqeBA0aybS
# Rp3796djgjkqozkv7AFGHrOIGiLDtCh4W1JYuML7kLN7IvuJoHSY+AHzfhDiae1l
# eluX/Cs/5rgEninwT9M0yEkgvUybA8+kx+z96hBJgkfJOrdbETc7YVbU5iP/sOOF
# UtfEVWGwT1RJOun0qrgEhHiJCTMcHyJjSEy8D867ymC+knu3OZIz22+axcmpHz6i
# QJFgY40OCP1yxBvPVLR3K/Z0se/FkxG55LwM58j7N/m+VDv4IqZCTbkZb5BTJVla
# 5vKgIrZfZ+XFqrenyMsBnBLgQuyCmDJIDFfxM0A9gOvJbwtf8T4DhL9FoRvVZMDD
# SHBl/EZcViXFDDKVHjotBSA5JoNbjHac5J5jCFu7pRq+2DbzxWHmW6xV7sY9gkSO
# +SdW9hcmF/vF5MKHfoQR2kVLLJ2/EKHiN/xVVsha0+RQDctucrhg1Y9MS2obJV3u
# u2udaVk5UNcfNPuVPwkG8YQ0sIyuDYXOTThwNtsj0tyZ+tGVQmMIlou/GAsrc9PF
# xmqzkCXXyrILrPMQJrYBcdwasBLuEcJMW59BqgxHCVP9NiAQgsNVzXFg4mr3+mVF
# xTrt8wioTvAPoDvXe+BPoaH6AsIY2TqE8j7IqA1Q/IFNf+KLYkPcHknZfzfxSkdW
# woRHVtjrkMo=
# =lW5h
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 06 Feb 2024 07:16:07 GMT
# gpg:                using RSA key 1BD9CAAD735C4C3A460DFCCA4DDE10F700FF835A
# gpg:                issuer "david@redhat.com"
# gpg: Good signature from "David Hildenbrand <david@redhat.com>" [marginal]
# gpg:                 aka "David Hildenbrand <davidhildenbrand@gmail.com>" 
[full]
# gpg:                 aka "David Hildenbrand <hildenbr@in.tum.de>" [unknown]
# Primary key fingerprint: 1BD9 CAAD 735C 4C3A 460D  FCCA 4DDE 10F7 00FF 835A

* tag 'mem-2024-02-06-v3' of https://github.com/davidhildenbrand/qemu:
  oslib-posix: initialize backend memory objects in parallel
  memory-device: reintroduce memory region size check
  hv-balloon: use get_min_alignment() to express 32 GiB alignment

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


  Commit: d05f553a7f8d16d181a5cea66ddec752fb12292a
      
https://github.com/qemu/qemu/commit/d05f553a7f8d16d181a5cea66ddec752fb12292a
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-02-07 (Wed, 07 Feb 2024)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into 
staging

Pull request

A bug fix for in-flight I/O during ioeventfd shutdown.

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmXCULQACgkQnKSrs4Gr
# c8hgpQf+K1Lw6S9S24P8GRkAsJWE0gSb1Nky/PkiL7rOzh92nUHPz3XCGgaCnEDP
# PjGJ8SYuCorSpu+TsRvamDbu9nfoQMRT+5V+xIXwZ6mziJKxDAJYdKViqObd6jZ9
# 76TNeW9c3ijE8FDWtm45PAtGIWThnrrVQpO50tprS1Fpasbv+TRLDMZO7BDKb4Yp
# yaRqBdX1Q5qpy6LSWtIx5Owxc884yDr3izoRIgQSRAeeWMJ2wk28m+xzTxtKzMWB
# ALjAM3DNs+CCv4OoE1JCpqOt4q8cXe1ZbjK8YiweEvuwOdsnyRBFCWx34jOOh7OC
# Uk13nep3pAoQAidotm56FSX2pkDZ7w==
# =oFrM
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 06 Feb 2024 15:31:00 GMT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
  virtio-blk: avoid using ioeventfd state in irqfd conditional

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/c165d4aac550...d05f553a7f8d



reply via email to

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