Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307983
b: refs/heads/master
c: 4d5914d
h: refs/heads/master
i:
  307981: 370cea1
  307979: a0fa290
  307975: 7788cc9
  307967: a4eb8d8
v: v3
  • Loading branch information
Kautuk Consul authored and Jesper Nilsson committed Apr 4, 2012
1 parent c405f23 commit 41d8fb1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dfb73a071f0259ba81ceea7b7f312f63dd18c73c
refs/heads/master: 4d5914d628360c607dc426ccb1acaf23909ac546
31 changes: 26 additions & 5 deletions trunk/arch/cris/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
struct vm_area_struct * vma;
siginfo_t info;
int fault;
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
((writeaccess & 1) ? FAULT_FLAG_WRITE : 0);

D(printk(KERN_DEBUG
"Page fault for %lX on %X at %lX, prot %d write %d\n",
Expand Down Expand Up @@ -115,6 +117,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
if (in_atomic() || !mm)
goto no_context;

retry:
down_read(&mm->mmap_sem);
vma = find_vma(mm, address);
if (!vma)
Expand Down Expand Up @@ -163,18 +166,36 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
* the fault.
*/

fault = handle_mm_fault(mm, vma, address, (writeaccess & 1) ? FAULT_FLAG_WRITE : 0);
fault = handle_mm_fault(mm, vma, address, flags);

if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
return;

if (unlikely(fault & VM_FAULT_ERROR)) {
if (fault & VM_FAULT_OOM)
goto out_of_memory;
else if (fault & VM_FAULT_SIGBUS)
goto do_sigbus;
BUG();
}
if (fault & VM_FAULT_MAJOR)
tsk->maj_flt++;
else
tsk->min_flt++;

if (flags & FAULT_FLAG_ALLOW_RETRY) {
if (fault & VM_FAULT_MAJOR)
tsk->maj_flt++;
else
tsk->min_flt++;
if (fault & VM_FAULT_RETRY) {
flags &= ~FAULT_FLAG_ALLOW_RETRY;

/*
* No need to up_read(&mm->mmap_sem) as we would
* have already released it in __lock_page_or_retry
* in mm/filemap.c.
*/

goto retry;
}
}

up_read(&mm->mmap_sem);
return;
Expand Down

0 comments on commit 41d8fb1

Please sign in to comment.