qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	peterx@redhat.com, "Eric Blake" <eblake@redhat.com>
Subject: [Qemu-devel] [PATCH 0/4] iothread: create gcontext unconditionally
Date: Fri, 22 Feb 2019 11:14:09 +0800	[thread overview]
Message-ID: <20190222031413.20250-1-peterx@redhat.com> (raw)

When I first read the iothread code, the gcontext confused me for
quite a while.  Meanwhile, I've been tackling with some races due to
this complexity as well.  How much we'll pay for creating the gcontext
unconditionally?  Do we really need this flexibitily (or is it really
a flexibility after all)?  I don't see much gain of existing code, but
I might be wrong.  Anyway, I wrote this patchset to see how the list
would think about it.

This series directly originates from previous discussion with
Marc-Andre where there's a slightly hacky way to try to acquire the
gcontext:

https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg05460.html

Now with this series logically above patch is not needed any more.
Please read patch 4 for more information.

And if this patchset can survive... how about running gcontext
directly in iothread_run()?  I believe there could be a bit more
things to clean but I'll see.

Make check passes for me.

Comments welcomed.  Thanks,

Peter Xu (4):
  iothread: replace init_done_cond with a semaphore
  iothread: create the gcontext onconditionally
  iothread: create main loop unconditionally
  iothread: push gcontext earlier in the thread_fn

 include/sysemu/iothread.h |  5 +--
 iothread.c                | 77 +++++++++++++++------------------------
 2 files changed, 32 insertions(+), 50 deletions(-)

-- 
2.17.1

             reply	other threads:[~2019-02-22  3:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  3:14 Peter Xu [this message]
2019-02-22  3:14 ` [Qemu-devel] [PATCH 1/4] iothread: replace init_done_cond with a semaphore Peter Xu
2019-02-22  6:25   ` Marc-André Lureau
2019-02-22  6:36     ` Peter Xu
2019-02-22  9:27       ` Paolo Bonzini
2019-02-22  9:44         ` Marc-André Lureau
2019-02-27 13:26   ` Stefan Hajnoczi
2019-02-22  3:14 ` [Qemu-devel] [PATCH 2/4] iothread: create the gcontext onconditionally Peter Xu
2019-02-22  6:29   ` Marc-André Lureau
2019-02-22  6:47     ` Peter Xu
2019-02-22  3:14 ` [Qemu-devel] [PATCH 3/4] iothread: create main loop unconditionally Peter Xu
2019-02-22  6:30   ` Marc-André Lureau
2019-02-22  3:14 ` [Qemu-devel] [PATCH 4/4] iothread: push gcontext earlier in the thread_fn Peter Xu
2019-02-22  6:37   ` Marc-André Lureau
2019-02-22  6:57     ` Peter Xu
2019-02-22  9:24       ` Paolo Bonzini
2019-02-27 13:38       ` Stefan Hajnoczi
2019-02-28  5:58         ` Peter Xu
2019-03-01 16:25           ` Stefan Hajnoczi
2019-03-04  2:26             ` Peter Xu
2019-03-04  9:12               ` Marc-André Lureau
2019-03-04  9:37                 ` Peter Xu
2019-02-22  9:28 ` [Qemu-devel] [PATCH 0/4] iothread: create gcontext unconditionally Paolo Bonzini
2019-02-22  9:45   ` Peter Xu
2019-03-06 10:19 ` Stefan Hajnoczi
2019-03-06 11:44   ` Peter Xu

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=20190222031413.20250-1-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).