qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] e7e4f9: block: mirror: fix wrong comment of m


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e7e4f9: block: mirror: fix wrong comment of mirror_start
Date: Wed, 28 Sep 2016 15:30:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e7e4f9f950253ce5fb03f569868a21d6d7e3f8a2
      
https://github.com/qemu/qemu/commit/e7e4f9f950253ce5fb03f569868a21d6d7e3f8a2
  Author: Yaowei Bai <address@hidden>
  Date:   2016-09-28 (Wed, 28 Sep 2016)

  Changed paths:
    M include/block/block_int.h

  Log Message:
  -----------
  block: mirror: fix wrong comment of mirror_start

Obviously, we should write to '@target'.

Signed-off-by: Yaowei Bai <address@hidden>
Reviewed-by: Xiubo Li <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 6b9424689a32bb76942ec39f6d5c60b72eb002e0
      
https://github.com/qemu/qemu/commit/6b9424689a32bb76942ec39f6d5c60b72eb002e0
  Author: Yaowei Bai <address@hidden>
  Date:   2016-09-28 (Wed, 28 Sep 2016)

  Changed paths:
    M aio-posix.c

  Log Message:
  -----------
  aio-posix: avoid unnecessary aio_epoll_enabled() calls

As epoll whether enabled or not is a global setting, we can just
check it only once rather than checking it with every node iteration.
Through this we can avoid a lot of checks when epoll is not enabled.

Signed-off-by: Yaowei Bai <address@hidden>
Reviewed-by: Xiubo Li <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: eb7b5c35117bfb90dcfa881a0e3b23368c73fba6
      
https://github.com/qemu/qemu/commit/eb7b5c35117bfb90dcfa881a0e3b23368c73fba6
  Author: Lin Ma <address@hidden>
  Date:   2016-09-28 (Wed, 28 Sep 2016)

  Changed paths:
    M iothread.c

  Log Message:
  -----------
  iothread: check iothread->ctx before aio_context_unref to avoid assertion

if iothread->ctx is set to NULL, aio_context_unref triggers the assertion:
g_source_unref: assertion 'source != NULL' failed.
The patch fixes it.

Signed-off-by: Lin Ma <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 844c82296f8bd6ceff8d170f3740740f3ce84b73
      
https://github.com/qemu/qemu/commit/844c82296f8bd6ceff8d170f3740740f3ce84b73
  Author: Laurent Vivier <address@hidden>
  Date:   2016-09-28 (Wed, 28 Sep 2016)

  Changed paths:
    M tests/libqos/virtio.c

  Log Message:
  -----------
  libqos: fix qvring_init()

"vq->desc[i].addr" is a 64bit value,
so write it with writeq(), not writew().

struct vring_desc {
    __virtio64 addr;
    __virtio32 len;
    __virtio16 flags;
    __virtio16 next;
};

Signed-off-by: Laurent Vivier <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f643e469f31df735fd5c42ab317f96ebfe749871
      
https://github.com/qemu/qemu/commit/f643e469f31df735fd5c42ab317f96ebfe749871
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2016-09-28 (Wed, 28 Sep 2016)

  Changed paths:
    M include/qemu/coroutine.h
    M util/qemu-coroutine.c

  Log Message:
  -----------
  coroutine: add qemu_coroutine_entered() function

See the doc comments for a description of this new coroutine API.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: afe16f3f477bc656932a640a09769db486446f07
      
https://github.com/qemu/qemu/commit/afe16f3f477bc656932a640a09769db486446f07
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2016-09-28 (Wed, 28 Sep 2016)

  Changed paths:
    M tests/test-coroutine.c

  Log Message:
  -----------
  test-coroutine: test qemu_coroutine_entered()

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: fe121b9d3c4258e41f7efa4976bf79151b2d5dbb
      
https://github.com/qemu/qemu/commit/fe121b9d3c4258e41f7efa4976bf79151b2d5dbb
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2016-09-28 (Wed, 28 Sep 2016)

  Changed paths:
    M block/linux-aio.c

  Log Message:
  -----------
  linux-aio: fix re-entrant completion processing

Commit 0ed93d84edabc7656f5c998ae1a346fe8b94ca54 ("linux-aio: process
completions from ioq_submit()") added an optimization that processes
completions each time ioq_submit() returns with requests in flight.
This commit introduces a "Co-routine re-entered recursively" error which
can be triggered with -drive format=qcow2,aio=native.

Fam Zheng <address@hidden>, Kevin Wolf <address@hidden>, and I
debugged the following backtrace:

  (gdb) bt
  #0  0x00007ffff0a046f5 in raise () at /lib64/libc.so.6
  #1  0x00007ffff0a062fa in abort () at /lib64/libc.so.6
  #2  0x0000555555ac0013 in qemu_coroutine_enter (co=0x5555583464d0) at 
util/qemu-coroutine.c:113
  #3  0x0000555555a4b663 in qemu_laio_process_completions (address@hidden) at 
block/linux-aio.c:218
  #4  0x0000555555a4b874 in ioq_submit (address@hidden) at block/linux-aio.c:331
  #5  0x0000555555a4ba12 in laio_do_submit (address@hidden, address@hidden, 
address@hidden, address@hidden) at block/linux-aio.c:383
  #6  0x0000555555a4bbd3 in laio_co_submit (bs=<optimized out>, 
s=0x555557e2f7f0, fd=13, offset=2932727808, qiov=0x555559d38e20, type=1) at 
block/linux-aio.c:402
  #7  0x0000555555a4fd23 in bdrv_driver_preadv (address@hidden, address@hidden, 
address@hidden, address@hidden, flags=0) at block/io.c:804
  #8  0x0000555555a52b34 in bdrv_aligned_preadv (address@hidden, 
address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, 
flags=0) at block/io.c:1041
  #9  0x0000555555a52db8 in bdrv_co_preadv (child=<optimized out>, 
offset=2932727808, bytes=8192, address@hidden, address@hidden) at 
block/io.c:1133
  #10 0x0000555555a29629 in qcow2_co_preadv (bs=0x555556635890, 
offset=6178725888, bytes=8192, qiov=0x555557527840, flags=<optimized out>) at 
block/qcow2.c:1509
  #11 0x0000555555a4fd23 in bdrv_driver_preadv (address@hidden, address@hidden, 
address@hidden, address@hidden, flags=0) at block/io.c:804
  #12 0x0000555555a52b34 in bdrv_aligned_preadv (address@hidden, 
address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, 
flags=0) at block/io.c:1041
  #13 0x0000555555a52db8 in bdrv_co_preadv (child=<optimized out>, 
address@hidden, address@hidden, address@hidden, address@hidden) at 
block/io.c:1133
  #14 0x0000555555a4515a in blk_co_preadv (blk=0x5555566356d0, 
offset=6178725888, bytes=8192, qiov=0x555557527840, flags=0) at 
block/block-backend.c:783
  #15 0x0000555555a45266 in blk_aio_read_entry (opaque=0x5555577025e0) at 
block/block-backend.c:991
  #16 0x0000555555ac0cfa in coroutine_trampoline (i0=<optimized out>, 
i1=<optimized out>) at util/coroutine-ucontext.c:78

It turned out that re-entrant ioq_submit() and completion processing
between three requests caused this error.  The following check is not
sufficient to prevent recursively entering coroutines:

  if (laiocb->co != qemu_coroutine_self()) {
      qemu_coroutine_enter(laiocb->co);
  }

As the following coroutine backtrace shows, not just the current
coroutine (self) can be entered.  There might also be other coroutines
that are currently entered and transferred control due to the qcow2 lock
(CoMutex):

  (gdb) qemu coroutine 0x5555583464d0
  #0  0x0000555555ac0c90 in qemu_coroutine_switch (address@hidden, 
address@hidden, address@hidden) at util/coroutine-ucontext.c:175
  #1  0x0000555555abfe54 in qemu_coroutine_enter (co=0x5555572f9890) at 
util/qemu-coroutine.c:117
  #2  0x0000555555ac031c in qemu_co_queue_run_restart (address@hidden) at 
util/qemu-coroutine-lock.c:60
  #3  0x0000555555abfe5e in qemu_coroutine_enter (co=0x5555583462c0) at 
util/qemu-coroutine.c:119
  #4  0x0000555555a4b663 in qemu_laio_process_completions (address@hidden) at 
block/linux-aio.c:218
  #5  0x0000555555a4b874 in ioq_submit (address@hidden) at block/linux-aio.c:331
  #6  0x0000555555a4ba12 in laio_do_submit (address@hidden, address@hidden, 
address@hidden, address@hidden) at block/linux-aio.c:383
  #7  0x0000555555a4bbd3 in laio_co_submit (bs=<optimized out>, 
s=0x555557e2f7f0, fd=13, offset=2911477760, qiov=0x55555a338e80, type=1) at 
block/linux-aio.c:402
  #8  0x0000555555a4fd23 in bdrv_driver_preadv (address@hidden, address@hidden, 
address@hidden, address@hidden, flags=0) at block/io.c:804
  #9  0x0000555555a52b34 in bdrv_aligned_preadv (address@hidden, 
address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, 
flags=0) at block/io.c:1041
  #10 0x0000555555a52db8 in bdrv_co_preadv (child=<optimized out>, 
offset=2911477760, bytes=8192, address@hidden, address@hidden) at 
block/io.c:1133
  #11 0x0000555555a29629 in qcow2_co_preadv (bs=0x555556635890, 
offset=6157475840, bytes=8192, qiov=0x5555575df720, flags=<optimized out>) at 
block/qcow2.c:1509
  #12 0x0000555555a4fd23 in bdrv_driver_preadv (address@hidden, address@hidden, 
address@hidden, address@hidden, flags=0) at block/io.c:804
  #13 0x0000555555a52b34 in bdrv_aligned_preadv (address@hidden, 
address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, 
flags=0) at block/io.c:1041
  #14 0x0000555555a52db8 in bdrv_co_preadv (child=<optimized out>, 
address@hidden, address@hidden, address@hidden, address@hidden) at 
block/io.c:1133
  #15 0x0000555555a4515a in blk_co_preadv (blk=0x5555566356d0, 
offset=6157475840, bytes=8192, qiov=0x5555575df720, flags=0) at 
block/block-backend.c:783
  #16 0x0000555555a45266 in blk_aio_read_entry (opaque=0x555557231aa0) at 
block/block-backend.c:991
  #17 0x0000555555ac0cfa in coroutine_trampoline (i0=<optimized out>, 
i1=<optimized out>) at util/coroutine-ucontext.c:78

Use the new qemu_coroutine_entered() function instead of comparing
against qemu_coroutine_self().  This is correct because:

1. If a coroutine is not entered then it must have yielded to wait for
   I/O completion.  It is therefore safe to enter.

2. If a coroutine is entered then it must be in
   ioq_submit()/qemu_laio_process_completions() because otherwise it
   would be yielded while waiting for I/O completion.  Therefore it will
   check laio->ret and return from ioq_submit() instead of yielding,
   i.e. it's guaranteed not to hang.

Reported-by: Fam Zheng <address@hidden>
Tested-by: Fam Zheng <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


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

  Changed paths:
    M aio-posix.c
    M block/linux-aio.c
    M include/block/block_int.h
    M include/qemu/coroutine.h
    M iothread.c
    M tests/libqos/virtio.c
    M tests/test-coroutine.c
    M util/qemu-coroutine.c

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

# gpg: Signature made Wed 28 Sep 2016 19:15:22 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  linux-aio: fix re-entrant completion processing
  test-coroutine: test qemu_coroutine_entered()
  coroutine: add qemu_coroutine_entered() function
  libqos: fix qvring_init()
  iothread: check iothread->ctx before aio_context_unref to avoid assertion
  aio-posix: avoid unnecessary aio_epoll_enabled() calls
  block: mirror: fix wrong comment of mirror_start

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


Compare: https://github.com/qemu/qemu/compare/4af27939e523...bc63afaf5f6d

reply via email to

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