diff mbox series

[RFC,20/24] x86 fault handler: extend range locking to supported file vmas

Message ID 20200224203057.162467-21-walken@google.com (mailing list archive)
State New, archived
Headers show
Series Fine grained MM locking | expand

Commit Message

Michel Lespinasse Feb. 24, 2020, 8:30 p.m. UTC
Change the fault handler to operate with a fine grained range lock when
operating on any of the explicitly supported file types.

Signed-off-by: Michel Lespinasse <walken@google.com>
---
 arch/x86/mm/fault.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git arch/x86/mm/fault.c arch/x86/mm/fault.c
index 1e37284d373c..ca30952896e1 100644
--- arch/x86/mm/fault.c
+++ arch/x86/mm/fault.c
@@ -1456,9 +1456,9 @@  void do_user_addr_fault(struct pt_regs *regs,
 
 		/*
 		 * Fall back to locking the entire MM
-		 * when operating on file vma.
+		 * when the vm_ops do not support fine grained range locking.
 		 */
-		if (!vma_is_anonymous(vma)) {
+		if (!vma_is_anonymous(vma) && !vma->vm_ops->fine_grained) {
 			mm_read_range_unlock(mm, range);
 			range = mm_coarse_lock_range();
 			goto retry;