[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves
From: |
Alex Bligh |
Subject: |
Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves |
Date: |
Sat, 06 Jul 2013 17:31:56 +0100 |
--On 6 July 2013 17:24:57 +0100 Alex Bligh <address@hidden> wrote:
Add timed bottom halves. A timed bottom half is a bottom half that
will not execute until a given time has passed (qemu_bh_schedule_at)
or a given interval has passed (qemu_bh_schedule_in). Any qemu
clock can be used, and times are specified in nanoseconds.
For background, this patch resulted from a discussion with Kevin & Stefan
on IRC as to the best way to use timers (or rather avoid using timers)
in block drivers.
There is one thing I'm not entirely sure about:
+void qemu_bh_schedule_at(QEMUBH *bh, QEMUClock *clock, int64_t time)
+{
+ /* Allow rescheduling if already scheduled */
+ bh->scheduled = 1;
+ bh->idle = 0;
+ bh->clock = clock;
+ bh->time = time;
+ aio_notify(bh->ctx); /*FIXME: is this right?*/
+}
qemu_bh_schedule calls aio_notify, but qemu_bh_schedule_idle does
not. I am not quite sure why the latter doesn't - possibly through
not fully understanding the aio system. Should qemu_bh_schedule_at
be calling this, when I don't know whether the bh is scheduled
for 1 nanosecond ahead or 1 second?
--
Alex Bligh
- [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Alex Bligh, 2013/07/06
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves,
Alex Bligh <=
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Paolo Bonzini, 2013/07/15
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Alex Bligh, 2013/07/15
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Paolo Bonzini, 2013/07/15
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Alex Bligh, 2013/07/15
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Paolo Bonzini, 2013/07/16
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Alex Bligh, 2013/07/16
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Paolo Bonzini, 2013/07/16
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Alex Bligh, 2013/07/16
- Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves, Paolo Bonzini, 2013/07/16