Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39038
b: refs/heads/master
c: 7f7bbbe
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Linus Torvalds committed Oct 6, 2006
1 parent c7a03cd commit 6adc51e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 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: 1ca4cb2418c04914e4661c059cf5b7b9262c645a
refs/heads/master: 7f7bbbe50b8a28f4dfaa4cea939ddb50198c4a99
1 change: 1 addition & 0 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ static inline int page_mapped(struct page *page)
*/
#define NOPAGE_SIGBUS (NULL)
#define NOPAGE_OOM ((struct page *) (-1))
#define NOPAGE_REFAULT ((struct page *) (-2)) /* Return to userspace, rerun */

/*
* Error return values for the *_nopfn functions
Expand Down
9 changes: 6 additions & 3 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
default:
BUG();
}
cond_resched();
}
if (pages) {
pages[i] = page;
Expand Down Expand Up @@ -2169,11 +2170,13 @@ static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
* after the next truncate_count read.
*/

/* no page was available -- either SIGBUS or OOM */
if (new_page == NOPAGE_SIGBUS)
/* no page was available -- either SIGBUS, OOM or REFAULT */
if (unlikely(new_page == NOPAGE_SIGBUS))
return VM_FAULT_SIGBUS;
if (new_page == NOPAGE_OOM)
else if (unlikely(new_page == NOPAGE_OOM))
return VM_FAULT_OOM;
else if (unlikely(new_page == NOPAGE_REFAULT))
return VM_FAULT_MINOR;

/*
* Should we do an early C-O-W break?
Expand Down

0 comments on commit 6adc51e

Please sign in to comment.