[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qemu-commits
Subject:    [Qemu-commits] [qemu/qemu] 67a741: queue: add QSIMPLEQ_PREPEND()
From:       GitHub <noreply () github ! com>
Date:       2018-03-27 18:20:26
Message-ID: 5aba8b6a9cd5a_cb52afb190cdc002307d () hookshot-fe-d2afb11 ! cp1-iad ! github ! net ! mail
[Download RAW message or body]


  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 67a74148d8828f611fc5a7a23277b8eceb4c9430
      https://github.com/qemu/qemu/commit/67a74148d8828f611fc5a7a23277b8eceb4c9430
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2018-03-27 (Tue, 27 Mar 2018)

  Changed paths:
    M include/qemu/queue.h

  Log Message:
  -----------
  queue: add QSIMPLEQ_PREPEND()

QSIMPLEQ_CONCAT(a, b) joins a = a + b.  The new QSIMPLEQ_PREPEND(a, b)
API joins a = b + a.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20180322152834.12656-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: c40a2545700e9ad2ef67d5972484bbee4c83b2a6
      https://github.com/qemu/qemu/commit/c40a2545700e9ad2ef67d5972484bbee4c83b2a6
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2018-03-27 (Tue, 27 Mar 2018)

  Changed paths:
    M block/io.c
    M include/qemu/coroutine_int.h
    M util/qemu-coroutine-lock.c
    M util/qemu-coroutine.c

  Log Message:
  -----------
  coroutine: avoid co_queue_wakeup recursion

qemu_aio_coroutine_enter() is (indirectly) called recursively when
processing co_queue_wakeup.  This can lead to stack exhaustion.

This patch rewrites co_queue_wakeup in an iterative fashion (instead of
recursive) with bounded memory usage to prevent stack exhaustion.

qemu_co_queue_run_restart() is inlined into qemu_aio_coroutine_enter()
and the qemu_coroutine_enter() call is turned into a loop to avoid
recursion.

There is one change that is worth mentioning:  Previously, when
coroutine A queued coroutine B, qemu_co_queue_run_restart() entered
coroutine B from coroutine A.  If A was terminating then it would still
stay alive until B yielded.  After this patch B is entered by A's parent
so that a A can be deleted immediately if it is terminating.

It is safe to make this change since B could never interact with A if it
was terminating anyway.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20180322152834.12656-3-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 35111583aa03c1a918a3f68858ef86eb161c7c06
      https://github.com/qemu/qemu/commit/35111583aa03c1a918a3f68858ef86eb161c7c06
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2018-03-27 (Tue, 27 Mar 2018)

  Changed paths:
    M tests/test-aio.c

  Log Message:
  -----------
  coroutine: add test-aio coroutine queue chaining test case

Check that two coroutines can queue each other repeatedly without
hitting stack exhaustion.

Switch to qemu_init_main_loop() in main() because coroutines use
qemu_get_aio_context() - they don't know about test-aio's ctx variable.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20180322152834.12656-4-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: f5a53faad4bfbf1b86012a13055d2a1a774a42b6
      https://github.com/qemu/qemu/commit/f5a53faad4bfbf1b86012a13055d2a1a774a42b6
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2018-03-27 (Tue, 27 Mar 2018)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: add include/block/aio-wait.h

The include/block/aio-wait.h header file was added by commit
7719f3c968c59e1bcda7e177679dc765b59e578f ("block: extract
AIO_WAIT_WHILE() from BlockDriverState") without updating MAINTAINERS.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180312132204.23683-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 6cf38cbf2961c57bd85022cf9adf7ef85dae0f02
      https://github.com/qemu/qemu/commit/6cf38cbf2961c57bd85022cf9adf7ef85dae0f02
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2018-03-27 (Tue, 27 Mar 2018)

  Changed paths:
    M MAINTAINERS
    M block/io.c
    M include/qemu/coroutine_int.h
    M include/qemu/queue.h
    M tests/test-aio.c
    M util/qemu-coroutine-lock.c
    M util/qemu-coroutine.c

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

# gpg: Signature made Tue 27 Mar 2018 15:41:11 BST
# gpg:                using RSA key 9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  MAINTAINERS: add include/block/aio-wait.h
  coroutine: add test-aio coroutine queue chaining test case
  coroutine: avoid co_queue_wakeup recursion
  queue: add QSIMPLEQ_PREPEND()

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


Compare: https://github.com/qemu/qemu/compare/dfe732fb68ef...6cf38cbf2961

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic