[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets tim
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers |
Date: |
Wed, 21 Aug 2013 11:01:42 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Aug 15, 2013 at 09:34:21PM +0100, Alex Bligh wrote:
> @@ -150,13 +150,14 @@ aio_ctx_prepare(GSource *source, gint *timeout)
> {
> AioContext *ctx = (AioContext *) source;
> QEMUBH *bh;
> + int deadline;
>
> for (bh = ctx->first_bh; bh; bh = bh->next) {
> if (!bh->deleted && bh->scheduled) {
> if (bh->idle) {
> /* idle bottom halves will be polled at least
> * every 10ms */
> - *timeout = 10;
> + *timeout = qemu_soonest_timeout(*timeout, 10);
> } else {
> /* non-idle bottom halves will be executed
> * immediately */
I agree with Wenchao:
The docs explicitly say that .prepare() can set timeout to the maximum
timeout value that is required. It then explains that the "actual
timeout used" is the minimum of all timeout values - it's not our job to
calculate the minimum, glib will do that after calling all .prepare()
functions.
I would drop this hunk.
Stefan
- [Qemu-devel] [PATCHv11 09/31] aio / timers: Untangle include files, (continued)
- [Qemu-devel] [PATCHv11 09/31] aio / timers: Untangle include files, Alex Bligh, 2013/08/15
- [Qemu-devel] [PATCHv11 12/31] aio / timers: Add a notify callback to QEMUTimerList, Alex Bligh, 2013/08/15
- [Qemu-devel] [PATCHv11 14/31] aio / timers: Add aio_timer_init & aio_timer_new wrappers, Alex Bligh, 2013/08/15
- [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, Alex Bligh, 2013/08/15
- Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, Wenchao Xia, 2013/08/19
- Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, Alex Bligh, 2013/08/20
- Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, Wenchao Xia, 2013/08/20
- Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, Alex Bligh, 2013/08/20
- Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, Wenchao Xia, 2013/08/20
- Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, Alex Bligh, 2013/08/20
Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers,
Stefan Hajnoczi <=
[Qemu-devel] [PATCHv11 17/31] aio / timers: On timer modification, qemu_notify or aio_notify, Alex Bligh, 2013/08/15
[Qemu-devel] [PATCHv11 16/31] aio / timers: Convert mainloop to use timeout, Alex Bligh, 2013/08/15
[Qemu-devel] [PATCHv11 23/31] aio / timers: Add qemu_clock_get_ms and qemu_clock_get_ms, Alex Bligh, 2013/08/15
[Qemu-devel] [PATCHv11 18/31] aio / timers: Introduce new API timer_new and friends, Alex Bligh, 2013/08/15
[Qemu-devel] [PATCHv11 08/31] aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList, Alex Bligh, 2013/08/15
[Qemu-devel] [PATCHv11 25/31] aio / timers: Remove main_loop_timerlist, Alex Bligh, 2013/08/15
[Qemu-devel] [PATCHv11 22/31] aio / timers: Remove legacy qemu_clock_deadline & qemu_timerlist_deadline, Alex Bligh, 2013/08/15
[Qemu-devel] [PATCHv11 15/31] aio / timers: Convert aio_poll to use AioContext timers' deadline, Alex Bligh, 2013/08/15
[Qemu-devel] [PATCHv11 27/31] aio / timers: convert block_job_sleep_ns and co_sleep_ns to new API, Alex Bligh, 2013/08/15