qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH RFC 0/4] memory: Fix (/ Discuss) a few rcu issues


From: David Hildenbrand
Subject: Re: [PATCH RFC 0/4] memory: Fix (/ Discuss) a few rcu issues
Date: Fri, 3 Mar 2023 10:10:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 02.03.23 22:50, Peter Xu wrote:
On Thu, Mar 02, 2023 at 04:11:56PM +0100, David Hildenbrand wrote:
I guess the main concern here would be overhead from gabbing/releasing the
BQL very often, and blocking the BQL while we're eventually in the kernel,
clearing bitmaps, correct?

More or less yes.  I think it's pretty clear we move on with RCU unless
extremely necessary (which I don't think..), then it's about how to fix the
bug so rcu safety guaranteed.

What about an additional simple lock?

Like:

* register/unregister requires that new notifier lock + BQL
* traversing notifiers requires either that new lock or the BQL

We simply take the new lock in that problematic function. That would work as long as we don't require traversal of the notifiers concurrently -- and as long as we have a lot of bouncing back and forth (I don't think we have, even in the migration context, or am I wrong?).

That way we also make sure that each notifier is only called once. I'm not 100% sure if all notifiers would expect to be called concurrently.

--
Thanks,

David / dhildenb




reply via email to

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