qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 0f0858: util/async: add a human-readable name


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 0f0858: util/async: add a human-readable name to BHs for d...
Date: Fri, 09 Jul 2021 06:29:49 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 0f08586c7171757d77c27ee6c606e8a1c44ac6e3
      
https://github.com/qemu/qemu/commit/0f08586c7171757d77c27ee6c606e8a1c44ac6e3
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2021-07-05 (Mon, 05 Jul 2021)

  Changed paths:
    M include/block/aio.h
    M include/qemu/main-loop.h
    M tests/unit/ptimer-test-stubs.c
    M util/async.c
    M util/main-loop.c

  Log Message:
  -----------
  util/async: add a human-readable name to BHs for debugging

It can be difficult to debug issues with BHs in production environments.
Although BHs can usually be identified by looking up their ->cb()
function pointer, this requires debug information for the program. It is
also not possible to print human-readable diagnostics about BHs because
they have no identifier.

This patch adds a name to each BH. The name is not unique per instance
but differentiates between cb() functions, which is usually enough. It's
done by changing aio_bh_new() and friends to macros that stringify cb.

The next patch will use the name field when reporting leaked BHs.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210414200247.917496-2-stefanha@redhat.com>


  Commit: 023ca420ee3d4de76518d690afa98dcac33998ce
      
https://github.com/qemu/qemu/commit/023ca420ee3d4de76518d690afa98dcac33998ce
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2021-07-05 (Mon, 05 Jul 2021)

  Changed paths:
    M util/async.c

  Log Message:
  -----------
  util/async: print leaked BH name when AioContext finalizes

BHs must be deleted before the AioContext is finalized. If not, it's a
bug and probably indicates that some part of the program still expects
the BH to run in the future. That can lead to memory leaks, inconsistent
state, or just hangs.

Unfortunately the assert(flags & BH_DELETED) call in aio_ctx_finalize()
is difficult to debug because the assertion failure contains no
information about the BH!

Use the QEMUBH name field added in the previous patch to show a useful
error when a leaked BH is detected.

Suggested-by: Eric Ernst <eric.g.ernst@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210414200247.917496-3-stefanha@redhat.com>


  Commit: 0dfc7af2b287323dde0725c04f5765e0e508d9fd
      
https://github.com/qemu/qemu/commit/0dfc7af2b287323dde0725c04f5765e0e508d9fd
  Author: Akihiko Odaki <akihiko.odaki@gmail.com>
  Date:   2021-07-06 (Tue, 06 Jul 2021)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  block/file-posix: Optimize for macOS

This commit introduces "punch hole" operation and optimizes transfer
block size for macOS.

Thanks to Konstantin Nazarov for detailed analysis of a flaw in an
old version of this change:
https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5#gistcomment-3654667

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-id: 20210705130458.97642-1-akihiko.odaki@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 12a521b56d0538ca0363dd79db8f359cef40da69
      
https://github.com/qemu/qemu/commit/12a521b56d0538ca0363dd79db8f359cef40da69
  Author: Akihiko Odaki <akihiko.odaki@gmail.com>
  Date:   2021-07-06 (Tue, 06 Jul 2021)

  Changed paths:
    M hw/block/block.c
    M include/hw/block/block.h
    M tests/qemu-iotests/172.out

  Log Message:
  -----------
  block: Add backend_defaults property

backend_defaults property allow users to control if default block
properties should be decided with backend information.

If it is off, any backend information will be discarded, which is
suitable if you plan to perform live migration to a different disk backend.

If it is on, a block device may utilize backend information more
aggressively.

By default, it is auto, which uses backend information for block
sizes and ignores the others, which is consistent with the older
versions.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-id: 20210705130458.97642-2-akihiko.odaki@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 9f460c64e13897117f35ffb61f6f5e0102cabc70
      
https://github.com/qemu/qemu/commit/9f460c64e13897117f35ffb61f6f5e0102cabc70
  Author: Akihiko Odaki <akihiko.odaki@gmail.com>
  Date:   2021-07-06 (Tue, 06 Jul 2021)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block/io: Merge discard request alignments

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-id: 20210705130458.97642-3-akihiko.odaki@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 53c0123118a15cd25fe81acfa9617ddcbb9258fe
      
https://github.com/qemu/qemu/commit/53c0123118a15cd25fe81acfa9617ddcbb9258fe
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-07-08 (Thu, 08 Jul 2021)

  Changed paths:
    M block/file-posix.c
    M block/io.c
    M hw/block/block.c
    M include/block/aio.h
    M include/hw/block/block.h
    M include/qemu/main-loop.h
    M tests/qemu-iotests/172.out
    M tests/unit/ptimer-test-stubs.c
    M util/async.c
    M util/main-loop.c

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

Pull request

# gpg: Signature made Thu 08 Jul 2021 14:11:37 BST
# 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

* remotes/stefanha-gitlab/tags/block-pull-request:
  block/io: Merge discard request alignments
  block: Add backend_defaults property
  block/file-posix: Optimize for macOS
  util/async: print leaked BH name when AioContext finalizes
  util/async: add a human-readable name to BHs for debugging

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


Compare: https://github.com/qemu/qemu/compare/9db3065c62a9...53c0123118a1



reply via email to

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