Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35569
b: refs/heads/master
c: ee6a645
h: refs/heads/master
i:
  35567: 89c4e30
v: v3
  • Loading branch information
Peter Zijlstra authored and Linus Torvalds committed Sep 26, 2006
1 parent f696dab commit cf1fcea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 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: e88dd6c11c5aef74d8b74a062767add53315533b
refs/heads/master: ee6a6457886a80415db209e87033b63f2b06558c
19 changes: 13 additions & 6 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,11 +1467,21 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
goto gotten;

/*
* Only catch write-faults on shared writable pages, read-only
* shared pages can get COWed by get_user_pages(.write=1, .force=1).
* Take out anonymous pages first, anonymous shared vmas are
* not dirty accountable.
*/
if (unlikely((vma->vm_flags & (VM_WRITE|VM_SHARED)) ==
if (PageAnon(old_page)) {
if (!TestSetPageLocked(old_page)) {
reuse = can_share_swap_page(old_page);
unlock_page(old_page);
}
} else if (unlikely((vma->vm_flags & (VM_WRITE|VM_SHARED)) ==
(VM_WRITE|VM_SHARED))) {
/*
* Only catch write-faults on shared writable pages,
* read-only shared pages can get COWed by
* get_user_pages(.write=1, .force=1).
*/
if (vma->vm_ops && vma->vm_ops->page_mkwrite) {
/*
* Notify the address space that the page is about to
Expand Down Expand Up @@ -1503,9 +1513,6 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
dirty_page = old_page;
get_page(dirty_page);
reuse = 1;
} else if (PageAnon(old_page) && !TestSetPageLocked(old_page)) {
reuse = can_share_swap_page(old_page);
unlock_page(old_page);
}

if (reuse) {
Expand Down

0 comments on commit cf1fcea

Please sign in to comment.