[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/2] QEMUBH: make AioContext's bh re-entrant
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v3 2/2] QEMUBH: make AioContext's bh re-entrant |
Date: |
Thu, 20 Jun 2013 11:19:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
Il 20/06/2013 11:12, liu ping fan ha scritto:
>> Right. You need to order ->idle writes before ->scheduled writes, and
>> add memory barriers, or alternatively use two bits in ->scheduled so
>> that you can assign both atomically.
>>
> I think just shift the position of smp_rmb/wmb in _schedule and _poll,
> we can acheive this (callbacks will not refer to ->idle)
Yes, but you also need to swap ->idle and ->scheduled assignments
(aio_bh_poll reads scheduled before idle; qemu_bh_schedule* must write
idle before scheduled).
Paolo