qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	"Shergill, Gurinder" <gurinder.shergill@hp.com>,
	qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Vinod, Chegu" <chegu_vinod@hp.com>
Subject: Re: [Qemu-devel] [PATCH v6 4/7] iothread: add I/O thread object
Date: Tue, 11 Mar 2014 19:39:07 +0100	[thread overview]
Message-ID: <20140311183907.GA29291@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <531F56A1.9000109@suse.de>

On Tue, Mar 11, 2014 at 07:32:01PM +0100, Andreas Färber wrote:
> Am 03.03.2014 11:30, schrieb Stefan Hajnoczi:
> > This is a stand-in for Michael Roth's QContext.  I expect this to be
> > replaced once QContext is completed.
> > 
> > The IOThread object is an AioContext event loop thread.  This patch adds
> > the concept of multiple event loop threads, allowing users to define
> > them.
> > 
> > When SMP guests run on SMP hosts it makes sense to instantiate multiple
> > IOThreads.  This spreads event loop processing across multiple cores.
> > Note that additional patches are required to actually bind a device to
> > an IOThread.
> > 
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> >  Makefile.objs             |   1 +
> >  include/sysemu/iothread.h |  30 ++++++++++++
> >  iothread.c                | 119 ++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 150 insertions(+)
> >  create mode 100644 include/sysemu/iothread.h
> >  create mode 100644 iothread.c
> > 
> > diff --git a/Makefile.objs b/Makefile.objs
> > index 4a62913..846ed66 100644
> > --- a/Makefile.objs
> > +++ b/Makefile.objs
> > @@ -44,6 +44,7 @@ libcacard-y += libcacard/vcardt.o
> >  
> >  ifeq ($(CONFIG_SOFTMMU),y)
> >  common-obj-y = blockdev.o blockdev-nbd.o block/
> > +common-obj-y += iothread.o
> >  common-obj-y += net/
> >  common-obj-y += qdev-monitor.o device-hotplug.o
> >  common-obj-$(CONFIG_WIN32) += os-win32.o
> > diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h
> > new file mode 100644
> > index 0000000..a32214a
> > --- /dev/null
> > +++ b/include/sysemu/iothread.h
> > @@ -0,0 +1,30 @@
> > +/*
> > + * Event loop thread
> > + *
> > + * Copyright Red Hat Inc., 2013
> > + *
> > + * Authors:
> > + *  Stefan Hajnoczi   <stefanha@redhat.com>
> > + *
> > + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> > + * See the COPYING file in the top-level directory.
> > + *
> > + */
> > +
> > +#ifndef IOTHREAD_H
> > +#define IOTHREAD_H
> > +
> > +#include "block/aio.h"
> > +
> > +#define TYPE_IOTHREAD "iothread"
> > +
> > +typedef struct IOThread IOThread;
> > +
> > +#define IOTHREAD(obj) \
> > +   OBJECT_CHECK(IOThread, obj, TYPE_IOTHREAD)
> > +
> > +IOThread *iothread_find(const char *id);
> > +char *iothread_get_id(IOThread *iothread);
> > +AioContext *iothread_get_aio_context(IOThread *iothread);
> > +
> > +#endif /* IOTHREAD_H */
> > diff --git a/iothread.c b/iothread.c
> > new file mode 100644
> > index 0000000..231ce6c
> > --- /dev/null
> > +++ b/iothread.c
> > @@ -0,0 +1,119 @@
> > +/*
> > + * Event loop thread
> > + *
> > + * Copyright Red Hat Inc., 2013
> > + *
> > + * Authors:
> > + *  Stefan Hajnoczi   <stefanha@redhat.com>
> > + *
> > + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> > + * See the COPYING file in the top-level directory.
> > + *
> > + */
> > +
> > +#include "qom/object.h"
> > +#include "qom/object_interfaces.h"
> > +#include "qemu/module.h"
> > +#include "qemu/thread.h"
> > +#include "block/aio.h"
> > +#include "sysemu/iothread.h"
> > +
> > +#define IOTHREADS_PATH "/objects"
> > +
> > +typedef ObjectClass IOThreadClass;
> > +struct IOThread {
> > +    Object parent;
> 
> Can you rename to parent_obj in your tree please and leave a while line
> after?

Sure.  Note that there are still other instances of this in the tree.

Stefan

  reply	other threads:[~2014-03-11 18:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 10:30 [Qemu-devel] [PATCH v6 0/7] dataplane: switch to N:M devices-per-thread model Stefan Hajnoczi
2014-03-03 10:30 ` [Qemu-devel] [PATCH v6 1/7] object: add object_get_canonical_path_component() Stefan Hajnoczi
2014-03-11 18:28   ` Andreas Färber
2014-03-03 10:30 ` [Qemu-devel] [PATCH v6 2/7] rfifolock: add recursive FIFO lock Stefan Hajnoczi
2014-03-03 10:30 ` [Qemu-devel] [PATCH v6 3/7] aio: add aio_context_acquire() and aio_context_release() Stefan Hajnoczi
2014-03-03 10:30 ` [Qemu-devel] [PATCH v6 4/7] iothread: add I/O thread object Stefan Hajnoczi
2014-03-11 18:32   ` Andreas Färber
2014-03-11 18:39     ` Stefan Hajnoczi [this message]
2014-03-03 10:30 ` [Qemu-devel] [PATCH v6 5/7] qdev: make get_pointer() handle temporary strings Stefan Hajnoczi
2014-03-11 18:29   ` Andreas Färber
2014-03-03 10:30 ` [Qemu-devel] [PATCH v6 6/7] iothread: add "iothread" qdev property type Stefan Hajnoczi
2014-03-03 10:30 ` [Qemu-devel] [PATCH v6 7/7] dataplane: replace internal thread with IOThread Stefan Hajnoczi
2014-03-11 18:27 ` [Qemu-devel] [PATCH v6 0/7] dataplane: switch to N:M devices-per-thread model Stefan Hajnoczi

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=20140311183907.GA29291@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=afaerber@suse.de \
    --cc=chegu_vinod@hp.com \
    --cc=famz@redhat.com \
    --cc=gurinder.shergill@hp.com \
    --cc=kwolf@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --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).