[PATCH 0/2] util/async: print leaked BH name when AioContext finalizes

Stefan Hajnoczi posted 2 patches 3 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210414200247.917496-1-stefanha@redhat.com
include/block/aio.h            | 31 ++++++++++++++++++++++++++++---
include/qemu/main-loop.h       |  4 +++-
tests/unit/ptimer-test-stubs.c |  2 +-
util/async.c                   | 25 +++++++++++++++++++++----
util/main-loop.c               |  4 ++--
5 files changed, 55 insertions(+), 11 deletions(-)
[PATCH 0/2] util/async: print leaked BH name when AioContext finalizes
Posted by Stefan Hajnoczi 3 years ago
Eric Ernst and I debugged a BH leak and it was more involved than it should be.
The problem is that BHs don't have a human-readable identifier, so low-level
debugging techniques and inferences about the code are required to figure out
which BH was leaked in production environments without easy debug access.

The leak ended up already being fixed upstream but let's improve diagnostics
for leaked BHs so that this becomes quick and easy in the future.

Stefan Hajnoczi (2):
  util/async: add a human-readable name to BHs for debugging
  util/async: print leaked BH name when AioContext finalizes

 include/block/aio.h            | 31 ++++++++++++++++++++++++++++---
 include/qemu/main-loop.h       |  4 +++-
 tests/unit/ptimer-test-stubs.c |  2 +-
 util/async.c                   | 25 +++++++++++++++++++++----
 util/main-loop.c               |  4 ++--
 5 files changed, 55 insertions(+), 11 deletions(-)

-- 
2.30.2

Re: [PATCH 0/2] util/async: print leaked BH name when AioContext finalizes
Posted by Fam Zheng 3 years ago
On 2021-04-14 21:02, Stefan Hajnoczi wrote:
> Eric Ernst and I debugged a BH leak and it was more involved than it should be.
> The problem is that BHs don't have a human-readable identifier, so low-level
> debugging techniques and inferences about the code are required to figure out
> which BH was leaked in production environments without easy debug access.
> 
> The leak ended up already being fixed upstream but let's improve diagnostics
> for leaked BHs so that this becomes quick and easy in the future.
> 
> Stefan Hajnoczi (2):
>   util/async: add a human-readable name to BHs for debugging
>   util/async: print leaked BH name when AioContext finalizes
> 
>  include/block/aio.h            | 31 ++++++++++++++++++++++++++++---
>  include/qemu/main-loop.h       |  4 +++-
>  tests/unit/ptimer-test-stubs.c |  2 +-
>  util/async.c                   | 25 +++++++++++++++++++++----
>  util/main-loop.c               |  4 ++--
>  5 files changed, 55 insertions(+), 11 deletions(-)
> 
> -- 
> 2.30.2
> 

Reviewed-by: Fam Zheng <fam@euphon.net>