qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH v9 15/23] aio: replace stack of bottom halve


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH v9 15/23] aio: replace stack of bottom halves with queue
Date: Wed, 18 Feb 2015 14:06:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


On 18/02/2015 12:57, Pavel Dovgalyuk wrote:
> +        QSIMPLEQ_FOREACH_SAFE(bh, &ctx->bh_queue, next, next) {
>              if (bh->deleted) {
> -                *bhp = bh->next;
> +                QSIMPLEQ_REMOVE(&ctx->bh_queue, bh, QEMUBH, next);

QSIMPLEQ_REMOVE is very inefficient, so that this loop can become
O(n^2).  You could use QTAILQ or introduce QSIMPLE_REMOVE_AFTER.

Paolo

>                  g_free(bh);
> -            } else {
> -                bhp = &bh->next;
>              }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]