Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1632218

[RFC v3 14/17] x86/mm: Update the handle_speculative_fault's path

From Laurent Dufour <ldufour@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [RFC v3 14/17] x86/mm: Update the handle_speculative_fault's path
Date 2017-04-27 18:00 +0200
Message-ID <tATZN-2FN-45@gated-at.bofh.it> (permalink)
References <tATZL-2FN-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


If handle_speculative_fault failed due to a VM ERROR, we try again the
slow path to allow the signal to be delivered.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
---
 arch/x86/mm/fault.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index ee6d8799d958..8f3bd8a53d66 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -1320,10 +1320,14 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
 		fault = handle_speculative_fault(mm, address,
 					flags & ~FAULT_FLAG_ALLOW_RETRY);
 
-		if (fault & VM_FAULT_RETRY)
-			goto retry;
-
-		goto done;
+		/*
+		 * We also check against VM_FAULT_ERROR because we have to
+		 * raise a signal by calling later mm_fault_error() which
+		 * requires the vma pointer to be set. So in that case,
+		 * we fall through the normal path.
+		 */
+		if (!(fault & VM_FAULT_RETRY || fault & VM_FAULT_ERROR))
+			goto done;
 	}
 
 	/*
@@ -1429,20 +1433,13 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
 		return;
 	}
 
-	if (unlikely(fault & VM_FAULT_RETRY)) {
-		if (fatal_signal_pending(current))
-			return;
-
-		goto done;
-	}
-
 	up_read(&mm->mmap_sem);
-done:
 	if (unlikely(fault & VM_FAULT_ERROR)) {
 		mm_fault_error(regs, error_code, address, vma, fault);
 		return;
 	}
 
+done:
 	/*
 	 * Major/minor page fault accounting. If any of the events
 	 * returned VM_FAULT_MAJOR, we account it as a major fault.
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC v3 00/17] Speculative page faults Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
  [RFC v3 03/17] mm: Introduce pte_spinlock Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
    Re: [RFC v3 03/17] mm: Introduce pte_spinlock Matthew Wilcox <willy@infradead.org> - 2017-04-30 06:50 +0200
      Re: [RFC v3 03/17] mm: Introduce pte_spinlock Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-05-03 15:10 +0200
  [RFC v3 13/17] mm/spf Protect vm_policy's changes against speculative pf Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
  [RFC v3 04/17] mm: VMA sequence count Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
  [RFC v3 02/17] mm: Prepare for FAULT_FLAG_SPECULATIVE Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
  [RFC v3 12/17] mm/spf: Protect changes to vm_flags Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
  [RFC v3 14/17] x86/mm: Update the handle_speculative_fault's path Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
  [RFC v3 06/17] mm: Provide speculative fault infrastructure Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
  [RFC v3 16/17] mm: protect madvise vs speculative pf Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
  [RFC v3 09/17] mm/spf: Fix fe.sequence init in __handle_mm_fault() Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200
  [RFC v3 08/17] mm/spf: Try spin lock in speculative path Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-27 18:00 +0200

csiph-web