[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 15/16] qcow2: Cancel COW when overwritten
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH 15/16] qcow2: Cancel COW when overwritten |
Date: |
Tue, 18 Sep 2012 17:08:47 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 |
Il 18/09/2012 17:05, Paolo Bonzini ha scritto:
>>>>>> >>> >> + qemu_co_mutex_unlock(&s->lock);
>>>>>> >>> >> + qemu_co_rwlock_wrlock(&m->l2_writeback_lock);
>>>> >> >
>>>> >> > Can anybody else take the lock as reader again at this point? If
>>>> >> > not, I
>>>> >> > wonder if this is more clear if you write it as a CoQueue.
>> > This isn't "let one writer complete, then wake up n readers" (which
>> > would indeed be represented more naturally as CoQueue), but rather "let
>> > n readers complete, then wake up one writer".
> So would it be representable as a list of children (matching the parent
> pointer) and then unlocking is
>
> remove self from children list
> if the children list is empty, wake parent->co
>
> ?
Of course this only work if the list of children cannot become non-empty
anymore after the writer restarts.
Paolo
- Re: [Qemu-devel] [RFC PATCH 11/16] qcow2: Add error handling to the l2meta coroutine, (continued)