]> Git Repo - linux.git/commit
mm: allow page fault handlers to perform the COW
authorMatthew Wilcox <[email protected]>
Mon, 16 Feb 2015 23:58:50 +0000 (15:58 -0800)
committerLinus Torvalds <[email protected]>
Tue, 17 Feb 2015 01:56:03 +0000 (17:56 -0800)
commit2e4cdab0584fa884e0a81c4f45b93ce875c9fcaa
treec20a4224ed2ac8d5e9416c7fcc451cc144025626
parent283307c7607de2a06d3bfae4cfbf5a566d457090
mm: allow page fault handlers to perform the COW

Currently COW of an XIP file is done by first bringing in a read-only
mapping, then retrying the fault and copying the page.  It is much more
efficient to tell the fault handler that a COW is being attempted (by
passing in the pre-allocated page in the vm_fault structure), and allow
the handler to perform the COW operation itself.

The handler cannot insert the page itself if there is already a read-only
mapping at that address, so allow the handler to return VM_FAULT_LOCKED
and set the fault_page to be NULL.  This indicates to the MM code that the
i_mmap_lock is held instead of the page lock.

Signed-off-by: Matthew Wilcox <[email protected]>
Acked-by: Kirill A. Shutemov <[email protected]>
Cc: Andreas Dilger <[email protected]>
Cc: Boaz Harrosh <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/mm.h
mm/memory.c
This page took 0.055241 seconds and 4 git commands to generate.