From 833d2060237c5f868c23f1a92e8ae940a411526b Mon Sep 17 00:00:00 2001 From: Kautuk Consul Date: Tue, 20 Mar 2012 09:23:33 -0400 Subject: [PATCH] --- yaml --- r: 305403 b: refs/heads/master c: 393a86af71b5bc6b11eac8e1594fb8be4c2ce84c h: refs/heads/master i: 305401: f586887c446f0c4961767bdb09f6580d1f10752c 305399: 74ff1bbe67c2344535cef87cdabf2514a06b2cae v: v3 --- [refs] | 2 +- trunk/arch/hexagon/mm/vm_fault.c | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 3d52fa90f63f..0615e0ac53aa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 222c547ee7155045dc20c26d39191b0e9b49f6a8 +refs/heads/master: 393a86af71b5bc6b11eac8e1594fb8be4c2ce84c diff --git a/trunk/arch/hexagon/mm/vm_fault.c b/trunk/arch/hexagon/mm/vm_fault.c index c10b76ff9d65..06695cc4fe58 100644 --- a/trunk/arch/hexagon/mm/vm_fault.c +++ b/trunk/arch/hexagon/mm/vm_fault.c @@ -53,6 +53,8 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs) int si_code = SEGV_MAPERR; int fault; const struct exception_table_entry *fixup; + unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | + (cause > 0 ? FAULT_FLAG_WRITE : 0); /* * If we're in an interrupt or have no user context, @@ -63,6 +65,7 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs) local_irq_enable(); +retry: down_read(&mm->mmap_sem); vma = find_vma(mm, address); if (!vma) @@ -96,14 +99,23 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs) break; } - fault = handle_mm_fault(mm, vma, address, (cause > 0)); + fault = handle_mm_fault(mm, vma, address, flags); + + if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) + return; /* The most common case -- we are done. */ if (likely(!(fault & VM_FAULT_ERROR))) { - if (fault & VM_FAULT_MAJOR) - current->maj_flt++; - else - current->min_flt++; + if (flags & FAULT_FLAG_ALLOW_RETRY) { + if (fault & VM_FAULT_MAJOR) + current->maj_flt++; + else + current->min_flt++; + if (fault & VM_FAULT_RETRY) { + flags &= ~FAULT_FLAG_ALLOW_RETRY; + goto retry; + } + } up_read(&mm->mmap_sem); return;