From: Sean Christopherson <seanjc@google.com>
To: Boris Burkov <boris@bur.io>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
kernel-team@fb.com
Subject: Re: [PATCH] KVM: use set_page_dirty rather than SetPageDirty
Date: Wed, 26 Jan 2022 21:59:02 +0000 [thread overview]
Message-ID: <YfHEJpP+1c9QZxA0@google.com> (raw)
In-Reply-To: <08b5b2c516b81788ca411dc031d403de4594755e.1643226777.git.boris@bur.io>
On Wed, Jan 26, 2022, Boris Burkov wrote:
> I tested this fix on the workload and it did prevent the hangs. However,
> I am unsure if the fix is appropriate from a locking perspective, so I
> hope to draw some extra attention to that aspect. set_page_dirty_lock in
> mm/page-writeback.c has a comment about locking that says set_page_dirty
> should be called with the page locked or while definitely holding a
> reference to the mapping's host inode. I believe that the mmap should
> have that reference, so for fear of hurting KVM performance or
> introducing a deadlock, I opted for the unlocked variant.
KVM doesn't hold a reference per se, but it does subscribe to mmu_notifier events
and will not mark the page dirty after KVM has been instructed to unmap the page
(barring bugs, which we've had a slew of). So yeah, the unlocked variant should
be safe.
Is it feasible to trigger this behavior in a selftest? KVM has had, and probably
still has, many bugs that all boil down to KVM assuming guest memory is backed by
either anonymous memory or something like shmem/HugeTLBFS/memfd that isn't typically
truncated by the host.
next prev parent reply other threads:[~2022-01-26 21:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 19:54 [PATCH] KVM: use set_page_dirty rather than SetPageDirty Boris Burkov
2022-01-26 21:59 ` Sean Christopherson [this message]
2022-01-26 23:11 ` Boris Burkov
2022-01-27 0:02 ` Chris Mason
2022-01-27 1:36 ` Sean Christopherson
2022-01-27 15:00 ` Chris Mason
2022-01-27 12:20 ` Paolo Bonzini
2022-01-27 14:52 ` Chris Mason
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=YfHEJpP+1c9QZxA0@google.com \
--to=seanjc@google.com \
--cc=boris@bur.io \
--cc=kernel-team@fb.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.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).