[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields |
Date: |
Fri, 28 May 2021 15:44:47 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 |
28.05.2021 14:01, Paolo Bonzini wrote:
On 28/05/21 12:24, Paolo Bonzini wrote:
It's still more complicated, because you need to add some kind of
method = s->method;
This would even have to be a separate, one-line critical section...
Hm, so, we should set .use_copy_range in task, when it is initialized.
ret = block_copy_do_copy(..., method);
if (ret < 0 && method <= COPY_RANGE_SMALL) {
method = COPY_RANGE_READ_WRITE;
ret = block_copy_do_copy(..., method);
}
lock();
if (method == s->method) {
/* compute new method */
}
which makes it more complicated than this patch IMO. But yeah at least it's a
viable alternative to the atomics.
OK, I'm OK with patch as is. Finally I can refactor it later on top if needed..
I'll try now do some refactoring, you'll probably want to base on it, or
vise-versa, I'll rebase it later on top of these patches.
--
Best regards,
Vladimir
- Re: [PATCH v2 6/7] block-copy: atomic .cancelled and .finished fields in BlockCopyCallState, (continued)
- [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields, Emanuele Giuseppe Esposito, 2021/05/18
- Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields, Vladimir Sementsov-Ogievskiy, 2021/05/21
- Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields, Emanuele Giuseppe Esposito, 2021/05/25
- Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields, Vladimir Sementsov-Ogievskiy, 2021/05/25
- Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields, Paolo Bonzini, 2021/05/26
- Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields, Vladimir Sementsov-Ogievskiy, 2021/05/26
- Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields, Paolo Bonzini, 2021/05/28
- Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields, Paolo Bonzini, 2021/05/28
- Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields, Vladimir Sementsov-Ogievskiy, 2021/05/28
- Re: [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields,
Vladimir Sementsov-Ogievskiy <=
Re: [PATCH v2 0/7] block-copy: protect block-copy internal structures, Vladimir Sementsov-Ogievskiy, 2021/05/20
Re: [PATCH v2 0/7] block-copy: protect block-copy internal structures, Stefan Hajnoczi, 2021/05/27