qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-2.1? 2/2] thread-pool: avoid deadlock in nes


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH for-2.1? 2/2] thread-pool: avoid deadlock in nested aio_poll() calls
Date: Mon, 14 Jul 2014 12:49:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

Il 14/07/2014 10:36, Paolo Bonzini ha scritto:


to

            /* In case elem->common.cb() makes a nested aio_poll() call,
             * next may become invalid as well.  Instead of just
             * restarting the QLIST_FOREACH_SAFE, go through the BH
             * once more, which also avoids deadlock if element A's
             * callback waits for element B and both completed at the
             * same time.
             */
            qemu_bh_schedule(pool->completion_bh);
            elem->common.cb(elem->common.opaque, elem->ret);
            qemu_aio_release(elem);

This is of course missing here:

                break;

Paolo


There is no change in logic, it's just that the goto is switched to a BH
representing a continuation.  I am then not sure why
pool->completion_token is necessary?




reply via email to

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