qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Reiter <s.reiter@proxmox.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, slp@redhat.com,
	mreitz@redhat.com, stefanha@redhat.com, jsnow@redhat.com,
	dietmar@proxmox.com
Subject: qemu_coroutine_yield switches thread?
Date: Thu, 16 Apr 2020 10:06:36 +0200	[thread overview]
Message-ID: <5dde1955-49db-2626-1fa5-332e4d7a0928@proxmox.com> (raw)

Hi list,

quick question: Can a resume from a qemu_coroutine_yield happen in a 
different thread?

Well, it can, since I'm seeing it happen, but is that okay or a bug?

I.e. in a backup-job the following can sporadically trip:

   unsigned long tid = pthread_self();
   qemu_get_current_aio_context(); // returns main context
   qemu_coroutine_yield();
   qemu_get_current_aio_context(); // still returns main context, but:
   assert(tid == pthread_self()); // this fails

It seems to be called from a vCPU thread when it happens. VM uses no 
iothreads.

~



             reply	other threads:[~2020-04-16  8:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16  8:06 Stefan Reiter [this message]
2020-04-16  8:28 ` qemu_coroutine_yield switches thread? Kevin Wolf
2020-04-16 10:09   ` Dietmar Maurer
2020-04-16 11:04     ` Kevin Wolf

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=5dde1955-49db-2626-1fa5-332e4d7a0928@proxmox.com \
    --to=s.reiter@proxmox.com \
    --cc=dietmar@proxmox.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=slp@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    /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).