qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 40/42] coroutine-sigaltstack: use helper for allocating stack memory
Date: Mon,  5 Sep 2016 20:13:52 +0200	[thread overview]
Message-ID: <1473099234-10882-41-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1473099234-10882-1-git-send-email-kwolf@redhat.com>

From: Peter Lieven <pl@kamp.de>

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 util/coroutine-sigaltstack.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/util/coroutine-sigaltstack.c b/util/coroutine-sigaltstack.c
index 9c2854c..ccf4861 100644
--- a/util/coroutine-sigaltstack.c
+++ b/util/coroutine-sigaltstack.c
@@ -143,7 +143,6 @@ static void coroutine_trampoline(int signal)
 
 Coroutine *qemu_coroutine_new(void)
 {
-    const size_t stack_size = COROUTINE_STACK_SIZE;
     CoroutineUContext *co;
     CoroutineThreadState *coTS;
     struct sigaction sa;
@@ -164,7 +163,7 @@ Coroutine *qemu_coroutine_new(void)
      */
 
     co = g_malloc0(sizeof(*co));
-    co->stack = g_malloc(stack_size);
+    co->stack = qemu_alloc_stack(COROUTINE_STACK_SIZE);
     co->base.entry_arg = &old_env; /* stash away our jmp_buf */
 
     coTS = coroutine_get_thread_state();
@@ -189,7 +188,7 @@ Coroutine *qemu_coroutine_new(void)
      * Set the new stack.
      */
     ss.ss_sp = co->stack;
-    ss.ss_size = stack_size;
+    ss.ss_size = COROUTINE_STACK_SIZE;
     ss.ss_flags = 0;
     if (sigaltstack(&ss, &oss) < 0) {
         abort();
@@ -253,7 +252,7 @@ void qemu_coroutine_delete(Coroutine *co_)
 {
     CoroutineUContext *co = DO_UPCAST(CoroutineUContext, base, co_);
 
-    g_free(co->stack);
+    qemu_free_stack(co->stack, COROUTINE_STACK_SIZE);
     g_free(co);
 }
 
-- 
1.8.3.1

  parent reply	other threads:[~2016-09-05 18:15 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 18:13 [Qemu-devel] [PULL 00/42] Block layer patches Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 01/42] ide: ide-cd without drive property for empty drive Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 02/42] scsi: scsi-cd " Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 03/42] block: Accept node-name for block-stream Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 04/42] block: Accept node-name for block-commit Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 05/42] block: Accept node-name for blockdev-backup Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 06/42] block: Accept node-name for blockdev-mirror Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 07/42] block: Accept node-name for blockdev-snapshot-delete-internal-sync Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 08/42] block: Accept node-name for blockdev-snapshot-internal-sync Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 09/42] block: Accept node-name for change-backing-file Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 10/42] block: Accept node-name for drive-backup Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 11/42] block: Accept node-name for drive-mirror Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 12/42] nbd-server: Use a separate BlockBackend Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 13/42] nbd-server: Allow node name for nbd-server-add Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 14/42] block: switch blk_write_compressed() to byte-based interface Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 15/42] block: Convert bdrv_pwrite_compressed() to BdrvChild Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 16/42] block/io: reuse bdrv_co_pwritev() for write compressed Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 17/42] qcow2: add qcow2_co_pwritev_compressed Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 18/42] qcow2: cleanup qcow2_co_pwritev_compressed to avoid the recursion Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 19/42] vmdk: add vmdk_co_pwritev_compressed Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 20/42] qcow: add qcow_co_pwritev_compressed Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 21/42] qcow: cleanup qcow_co_pwritev_compressed to avoid the recursion Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 22/42] block: remove BlockDriver.bdrv_write_compressed Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 23/42] block/io: turn on dirty_bitmaps for the compressed writes Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 24/42] block: simplify drive-backup Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 25/42] block: simplify blockdev-backup Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 26/42] drive-backup: added support for data compression Kevin Wolf
2016-09-16 15:15   ` Eric Blake
2016-09-05 18:13 ` [Qemu-devel] [PULL 27/42] blockdev-backup: " Kevin Wolf
2016-09-16 15:15   ` Eric Blake
2016-09-05 18:13 ` [Qemu-devel] [PULL 28/42] qemu-iotests: test backup compression in 055 Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 29/42] qemu-iotests: add vmdk for " Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 30/42] test-coroutine: Fix coroutine pool corruption Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 31/42] qcow2: fix iovec size at qcow2_co_pwritev_compressed Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 32/42] coroutine: Let CoMutex remember who holds it Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 33/42] coroutine: Assert that no locks are held on termination Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 34/42] block jobs: Improve error message for missing job ID Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 35/42] qemu-iotests: Log QMP traffic in debug mode Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 36/42] block: Allow node name for 'qemu-io' HMP command Kevin Wolf
2016-09-15 22:18   ` Paolo Bonzini
2016-09-05 18:13 ` [Qemu-devel] [PULL 37/42] oslib-posix: add helpers for stack alloc and free Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 38/42] coroutine: add a macro for the coroutine stack size Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 39/42] coroutine-ucontext: use helper for allocating stack memory Kevin Wolf
2016-09-05 18:13 ` Kevin Wolf [this message]
2016-09-05 18:13 ` [Qemu-devel] [PULL 41/42] oslib-posix: add a configure switch to debug stack usage Kevin Wolf
2016-09-05 18:13 ` [Qemu-devel] [PULL 42/42] coroutine: reduce stack size to 64kB Kevin Wolf
2016-09-06 10:12 ` [Qemu-devel] [PULL 00/42] Block layer patches Peter Maydell
2016-09-06 10:36   ` Kevin Wolf
2016-09-16 13:25     ` Peter Lieven
2016-09-06 10:33 ` Peter Maydell
2016-09-06 10:42 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473099234-10882-41-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).