xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] x86/mm: remove arch-specific PTE/PMD get-and-clear functions
@ 2012-06-13 10:20 David Vrabel
  2012-06-13 10:20 ` [PATCH 1/2] x86/mm: remove arch-specific ptep_get_and_clear() function David Vrabel
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: David Vrabel @ 2012-06-13 10:20 UTC (permalink / raw)
  To: xen-devel
  Cc: David Vrabel, Konrad Rzeszutek Wilk, H. Peter Anvin, x86,
	linux-kernel

This series removes the x86-specific implementation of
ptep_get_and_clear() and pmdp_get_and_clear().

The principal reason for this is it allows Xen paravitualized guests
to batch the PTE clears which is a significant performance
optimization of munmap() and mremap() -- the number of entries into
the hypervisor is reduced by about a factor of about 30 (60 in 32-bit
guests) for munmap().

There may be minimal gains on native and KVM guests due to the removal
of the locked xchg.

Removal of arch-specific functions where generic ones are suitable
seems to be a generally useful thing to me.

The full reasoning for why this is safe is included in the commit
message of patch 1 but to summarize.  The atomic get-and-clear does
not guarantee that the latest dirty/accessed bits are returned as TLB
as there is a still a window after the get-and-clear and before the
TLB flush that the bits may be updated on other processors.  So, user
space applications accessing pages that are being unmapped or remapped
already have unpredictable behaviour.

David

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

end of thread, other threads:[~2012-06-18  9:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-13 10:20 [PATCH 0/2] x86/mm: remove arch-specific PTE/PMD get-and-clear functions David Vrabel
2012-06-13 10:20 ` [PATCH 1/2] x86/mm: remove arch-specific ptep_get_and_clear() function David Vrabel
2012-06-15  9:41   ` David Vrabel
2012-06-15 10:49     ` [Xen-devel] " Keir Fraser
2012-06-13 10:20 ` [PATCH 2/2] x86/mm: remove arch-specific pmdp_get_and_clear() function David Vrabel
2012-06-13 14:04 ` [PATCH 0/2] x86/mm: remove arch-specific PTE/PMD get-and-clear functions Konrad Rzeszutek Wilk
2012-06-13 15:00   ` David Vrabel
2012-06-14 18:29     ` Konrad Rzeszutek Wilk
2012-06-14 18:41       ` H. Peter Anvin
2012-06-18  9:13         ` Rusty Russell

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