linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET 0/2] Allow single pagefault in write access of a VM_MIXEDMAP mapping
@ 2016-01-10 13:59 Boaz Harrosh
  2016-01-10 14:02 ` [PATCH 1/2] mm: Allow single pagefault on mmap-write with VM_MIXEDMAP Boaz Harrosh
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Boaz Harrosh @ 2016-01-10 13:59 UTC (permalink / raw)
  To: Kirill A. Shutemov, Dan Williams, Andrew Morton, Matthew Wilcox,
	linux-mm@kvack.org
  Cc: Ross Zwisler, Oleg Nesterov, Mel Gorman, Johannes Weiner

Hi

Today any VM_MIXEDMAP or VM_PFN mapping when enabling a write access
to their mapping, will have a double pagefault for every write access.

This is because vma->vm_page_prot defines how a page/pfn is inserted into
the page table (see vma_wants_writenotify in mm/mmap.c).

Which means that it is always inserted with read-only under the
assumption that we want to be notified when write access occurs.

But this is not always true and adds an unnecessary page-fault on
every new mmap-write access

This patchset is trying to give the fault handler more choice by passing
an pgprot_t to vm_insert_mixed() via a new vm_insert_mixed_prot() API.

If the mm guys feel that the pgprot_t and its helpers and flags are private
to mm/memory.c I can easily do a new: vm_insert_mixed_rw() instead. of the
above vm_insert_mixed_prot() which enables any control not only write.

Following is a patch to DAX to optimize out the extra page-fault.

TODO: I only did 4k mapping perhaps 2M mapping can enjoy the same single
fault on write access. If interesting to anyone I can attempt a fix.

Dan Andrew who needs to pick this up please?

list of patches:
[PATCH 1/2] mm: Allow single pagefault on mmap-write with VM_MIXEDMAP
[PATCH 2/2] dax: Only fault once on mmap write access

Thank you
Boaz

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2016-01-12 13:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-10 13:59 [PATCHSET 0/2] Allow single pagefault in write access of a VM_MIXEDMAP mapping Boaz Harrosh
2016-01-10 14:02 ` [PATCH 1/2] mm: Allow single pagefault on mmap-write with VM_MIXEDMAP Boaz Harrosh
2016-01-10 14:03 ` [PATCH 2/2] dax: Only fault once on mmap write access Boaz Harrosh
2016-01-11  1:19 ` [PATCHSET 0/2] Allow single pagefault in write access of a VM_MIXEDMAP mapping Dan Williams
2016-01-11  9:22   ` Boaz Harrosh
2016-01-11 16:37     ` Dan Williams
2016-01-11 19:35 ` Matthew Wilcox
2016-01-12 13:29   ` Matthew Wilcox

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