From: Peter Xu <peterx@redhat.com>
To: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Cc: qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@mailo.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH] memory/ramblock: Fix clear of mru_block on possible race condition
Date: Thu, 4 Jun 2026 09:33:45 -0400 [thread overview]
Message-ID: <aiF-uS5MoQfjyY2d@x1.local> (raw)
In-Reply-To: <8eadb481-6d3a-459e-9db8-a9cca13d1cf4@rsg.ci.i.u-tokyo.ac.jp>
On Thu, Jun 04, 2026 at 02:24:07PM +0900, Akihiko Odaki wrote:
> On 2026/06/04 2:35, Peter Xu wrote:
> > On Wed, Jun 03, 2026 at 02:11:44PM +0900, Akihiko Odaki wrote:
> > > qemu_get_ram_block() may set mru_block during the grace period. Once
> > > mru_block is set, RCU readers can still access the ramblock, even if the
> > > block is no longer visible in ram_list.
> >
> > True..
> >
> > >
> > > When enriching the comment in reclaim_ramblock_prepare(), I think the phrase
> > > “the last reader that can access this ramblock is gone” could be improved.
> > > What matters here is that the last reader that could find the block in
> > > ram_list is gone. The block is no longer visible in ram_list to any later
> > > reader, and clearing the cache at that point ensures that it is no longer
> > > visible through an mru_block cache hit either.
> >
> > Yes that's ambiguous.
> >
> > I updated comments in this patch, removed the 1st reset of mru_block, and
> > when at it also touched up the comment in qemu_get_ram_block(), let me know
> > if there's further comments before repost.
>
> It looks good. You may repost it with my Reviewed-by added:
>
> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Thanks.
--
Peter Xu
prev parent reply other threads:[~2026-06-04 13:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 20:59 [PATCH] memory/ramblock: Fix clear of mru_block on possible race condition Peter Xu
2026-06-02 4:25 ` Akihiko Odaki
2026-06-02 19:51 ` Peter Xu
2026-06-03 5:11 ` Akihiko Odaki
2026-06-03 17:35 ` Peter Xu
2026-06-04 5:24 ` Akihiko Odaki
2026-06-04 13:33 ` Peter Xu [this message]
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=aiF-uS5MoQfjyY2d@x1.local \
--to=peterx@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=farosas@suse.de \
--cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
--cc=pbonzini@redhat.com \
--cc=philmd@mailo.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.