Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309706
b: refs/heads/master
c: 1cefe28
h: refs/heads/master
v: v3
  • Loading branch information
Kautuk Consul authored and Linus Torvalds committed Jun 1, 2012
1 parent 0820995 commit dfbfccc
Show file tree
Hide file tree
Showing 2 changed files with 20 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: 4f1c28d241d0882f25112d494885cd6084db225b
refs/heads/master: 1cefe28f95da307287a05a6a0c10213f01055e2a
24 changes: 19 additions & 5 deletions trunk/arch/um/kernel/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ int handle_page_fault(unsigned long address, unsigned long ip,
pmd_t *pmd;
pte_t *pte;
int err = -EFAULT;
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
(is_write ? FAULT_FLAG_WRITE : 0);

*code_out = SEGV_MAPERR;

Expand All @@ -40,6 +42,7 @@ int handle_page_fault(unsigned long address, unsigned long ip,
if (in_atomic())
goto out_nosemaphore;

retry:
down_read(&mm->mmap_sem);
vma = find_vma(mm, address);
if (!vma)
Expand All @@ -65,7 +68,11 @@ int handle_page_fault(unsigned long address, unsigned long ip,
do {
int fault;

fault = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0);
fault = handle_mm_fault(mm, vma, address, flags);

if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
goto out_nosemaphore;

if (unlikely(fault & VM_FAULT_ERROR)) {
if (fault & VM_FAULT_OOM) {
goto out_of_memory;
Expand All @@ -75,10 +82,17 @@ int handle_page_fault(unsigned long address, unsigned long ip,
}
BUG();
}
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;
}
}

pgd = pgd_offset(mm, address);
pud = pud_offset(pgd, address);
Expand Down

0 comments on commit dfbfccc

Please sign in to comment.