From: David Hildenbrand <david@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, "Maxim Levitsky" <mlevitsk@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
"Chuang Xu" <xuchuangxclwt@bytedance.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH RFC 0/4] memory: Fix (/ Discuss) a few rcu issues
Date: Fri, 3 Mar 2023 10:10:12 +0100 [thread overview]
Message-ID: <c4b70513-7cbc-a858-58ed-537c8fe7795e@redhat.com> (raw)
In-Reply-To: <ZAEaO7Yqw2F8hbbV@x1n>
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
next prev parent reply other threads:[~2023-03-03 9:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-25 16:31 [PATCH RFC 0/4] memory: Fix (/ Discuss) a few rcu issues Peter Xu
2023-02-25 16:31 ` [PATCH RFC 1/4] memory: Make memory_listeners RCU-safe for real Peter Xu
2023-02-25 16:31 ` [PATCH RFC 2/4] memory: Use rcu list variance for address_spaces modifications Peter Xu
2023-02-25 16:31 ` [PATCH RFC 3/4] memory: Protect memory_region_clear_dirty_bitmap with RCU Peter Xu
2023-02-25 16:31 ` [PATCH RFC 4/4] memory: Use rcu traversal in memory_region_to_address_space Peter Xu
2023-03-01 0:09 ` [PATCH RFC 0/4] memory: Fix (/ Discuss) a few rcu issues Stefan Hajnoczi
2023-03-01 16:08 ` Peter Xu
2023-03-02 9:46 ` David Hildenbrand
2023-03-02 14:45 ` Peter Xu
2023-03-02 14:56 ` Peter Xu
2023-03-02 15:11 ` David Hildenbrand
2023-03-02 21:50 ` Peter Xu
2023-03-03 9:10 ` David Hildenbrand [this message]
2023-03-03 16:20 ` Peter Xu
2023-03-03 16:58 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c4b70513-7cbc-a858-58ed-537c8fe7795e@redhat.com \
--to=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
--cc=xuchuangxclwt@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).