All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"laurent@vivier.eu" <laurent@vivier.eu>,
	"anthony@codemonkey.ws" <anthony@codemonkey.ws>
Subject: Re: [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait
Date: Mon, 05 Mar 2012 15:30:40 +0100	[thread overview]
Message-ID: <4F54CE10.4040407@siemens.com> (raw)
In-Reply-To: <4F54CC8A.5010509@redhat.com>

On 2012-03-05 15:24, Avi Kivity wrote:
>> Long-term, I'd like to cut out certain file descriptors from the main
>> loop and process them completely in separate threads (for separate
>> locking, prioritization etc.). Dunno how NBD works, but maybe it should
>> be reworked like this already.
> 
> Ideally qemu_set_fd_handler2() should be made thread local, and each
> device thread would run a copy of the main loop, just working on
> different data.

qemu_set_fd_handler2 may not only be called over an iothread. Rather, we
need an object and associated lock that is related to the io-path (i.e.
frontend device + backend driver). That object has to be passed to
services like qemu_set_fd_handler2.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>
Cc: "anthony@codemonkey.ws" <anthony@codemonkey.ws>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"laurent@vivier.eu" <laurent@vivier.eu>
Subject: Re: [Qemu-devel] [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait
Date: Mon, 05 Mar 2012 15:30:40 +0100	[thread overview]
Message-ID: <4F54CE10.4040407@siemens.com> (raw)
In-Reply-To: <4F54CC8A.5010509@redhat.com>

On 2012-03-05 15:24, Avi Kivity wrote:
>> Long-term, I'd like to cut out certain file descriptors from the main
>> loop and process them completely in separate threads (for separate
>> locking, prioritization etc.). Dunno how NBD works, but maybe it should
>> be reworked like this already.
> 
> Ideally qemu_set_fd_handler2() should be made thread local, and each
> device thread would run a copy of the main loop, just working on
> different data.

qemu_set_fd_handler2 may not only be called over an iothread. Rather, we
need an object and associated lock that is related to the io-path (i.e.
frontend device + backend driver). That object has to be passed to
services like qemu_set_fd_handler2.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  parent reply	other threads:[~2012-03-05 14:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05  8:34 [RFC PATCH] fix select(2) race between main_loop_wait and qemu_aio_wait Paolo Bonzini
2012-03-05  8:34 ` [Qemu-devel] " Paolo Bonzini
2012-03-05  9:07 ` Jan Kiszka
2012-03-05  9:07   ` [Qemu-devel] " Jan Kiszka
2012-03-05  9:25   ` Paolo Bonzini
2012-03-05  9:25     ` [Qemu-devel] " Paolo Bonzini
2012-03-05 14:24   ` Avi Kivity
2012-03-05 14:24     ` [Qemu-devel] " Avi Kivity
2012-03-05 14:30     ` Paolo Bonzini
2012-03-05 14:30       ` [Qemu-devel] " Paolo Bonzini
2012-03-05 15:14       ` Avi Kivity
2012-03-05 15:14         ` [Qemu-devel] " Avi Kivity
2012-03-05 16:14         ` Paolo Bonzini
2012-03-05 16:14           ` [Qemu-devel] " Paolo Bonzini
2012-03-05 17:35           ` Avi Kivity
2012-03-05 17:35             ` [Qemu-devel] " Avi Kivity
2012-03-06  9:01             ` Paolo Bonzini
2012-03-06  9:01               ` [Qemu-devel] " Paolo Bonzini
2012-03-05 14:30     ` Jan Kiszka [this message]
2012-03-05 14:30       ` Jan Kiszka
2012-03-05 17:39       ` Avi Kivity
2012-03-05 17:39         ` [Qemu-devel] " Avi Kivity
2012-03-05 17:55         ` Jan Kiszka
2012-03-05 17:55           ` [Qemu-devel] " Jan Kiszka

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=4F54CE10.4040407@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=laurent@vivier.eu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.