qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Using aio_poll for timer carrier threads
@ 2013-08-13  7:56 Jan Kiszka
  2013-08-13 13:45 ` Stefan Hajnoczi
  2013-08-13 14:45 ` Paolo Bonzini
  0 siblings, 2 replies; 15+ messages in thread
From: Jan Kiszka @ 2013-08-13  7:56 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Kevin Wolf, Anthony Liguori, qemu-devel, liu ping fan, Alex Bligh,
	Paolo Bonzini, MORITA Kazutaka, Richard Henderson

Hi Stefan,

in the attempt to use Alex' ppoll-based timer rework for decoupled,
real-time capable timer device models I'm now scratching my head over
the aio_poll interface. I'm looking at dataplane/virtio-blk.c, just finding

static void *data_plane_thread(void *opaque)
{
    VirtIOBlockDataPlane *s = opaque;

    do {
        aio_poll(s->ctx, true);
    } while (!s->stopping || s->num_reqs > 0);
    return NULL;
}

wondering where the locking is. Or doesn't this use need any at all? Are
all data structures that this thread accesses exclusively used by it, or
are they all accessed in a lock-less way?

Our iothread mainloop more or less open-codes aio_poll and is, thus,
able to drop its lock before falling asleep while still holding it
during event dispatching. Obviously, I need the same when processing
timer lists of an AioContext, protecting them against concurrent
modifications over VCPUs or other threads. So I'm thinking of adding a
block notification callback to aio_poll, to be called before/after
qemu_poll_ns so that any locks can be dropped / reacquired as needed. Or
am I missing some magic interface / pattern?

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-08-19 14:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-13  7:56 [Qemu-devel] Using aio_poll for timer carrier threads Jan Kiszka
2013-08-13 13:45 ` Stefan Hajnoczi
2013-08-13 14:13   ` Jan Kiszka
2013-08-14  0:48     ` liu ping fan
2013-08-14  8:52     ` Stefan Hajnoczi
2013-08-14  9:05       ` Jan Kiszka
2013-08-14 11:35         ` Stefan Hajnoczi
2013-08-14 12:32     ` Jan Kiszka
2013-08-19 12:00       ` Paolo Bonzini
2013-08-13 14:45 ` Paolo Bonzini
2013-08-13 14:54   ` Jan Kiszka
2013-08-19 13:21     ` Paolo Bonzini
2013-08-19 13:40       ` Jan Kiszka
2013-08-19 14:09         ` Paolo Bonzini
2013-08-19 13:58       ` Alex Bligh

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).