kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
* Reference count on pages held in secondary MMUs
@ 2019-06-09  8:18 Christoffer Dall
  2019-06-09  9:37 ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Christoffer Dall @ 2019-06-09  8:18 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, kvmarm

Hi,

I have been looking at how we deal with page_count(page) on pages held
in stage 2 page tables on KVM/arm64.

What we do currently is to drop the reference on the page we get from
get_user_pages() once the page is inserted into our stage 2 page table,
typically leaving page_count(page) == page_mapcount(page) == 1 which
represents the userspace stage 1 mapping of the page,
and we rely on MMU notifiers to remove the stage 2 mapping if
corresponding stage 1 mapping is being unmapped.

I believe this is analogous to what other architectures do?

In some sense, we are thus maintaining a 'hidden', or internal,
reference to the page, which is not counted anywhere.

I am wondering if it would be equally valid to take a reference on the
page, and remove that reference when unmapping via MMU notifiers, and if
so, if there would be any advantages/drawbacks in doing so?


Thanks,

    Christoffer
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-06-26 12:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-09  8:18 Reference count on pages held in secondary MMUs Christoffer Dall
2019-06-09  9:37 ` Paolo Bonzini
2019-06-09 17:40   ` Andrea Arcangeli
2019-06-11 11:51     ` Christoffer Dall
2019-06-22 19:11       ` Andrea Arcangeli
2019-06-26 12:16         ` Christoffer Dall
2019-06-11 11:21   ` Christoffer Dall
2019-06-11 11:29     ` Paolo Bonzini

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).