Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233143
b: refs/heads/master
c: e15f8c0
h: refs/heads/master
i:
  233141: 25eb376
  233139: ba7a381
  233135: 5cae0d9
v: v3
  • Loading branch information
Michel Lespinasse authored and Linus Torvalds committed Feb 12, 2011
1 parent 9085d5e commit a8afba6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 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: e6d2e2b2b1e1455df16d68a78f4a3874c7b3ad20
refs/heads/master: e15f8c01af924e611bc7be1e45449c4a74e5dfdd
26 changes: 12 additions & 14 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,6 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
&ptl);
if (!pte_same(*page_table, orig_pte)) {
unlock_page(old_page);
page_cache_release(old_page);
goto unlock;
}
page_cache_release(old_page);
Expand Down Expand Up @@ -2289,7 +2288,6 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
&ptl);
if (!pte_same(*page_table, orig_pte)) {
unlock_page(old_page);
page_cache_release(old_page);
goto unlock;
}

Expand Down Expand Up @@ -2367,16 +2365,6 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
}
__SetPageUptodate(new_page);

/*
* Don't let another task, with possibly unlocked vma,
* keep the mlocked page.
*/
if ((vma->vm_flags & VM_LOCKED) && old_page) {
lock_page(old_page); /* for LRU manipulation */
clear_page_mlock(old_page);
unlock_page(old_page);
}

if (mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))
goto oom_free_new;

Expand Down Expand Up @@ -2444,10 +2432,20 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,

if (new_page)
page_cache_release(new_page);
if (old_page)
page_cache_release(old_page);
unlock:
pte_unmap_unlock(page_table, ptl);
if (old_page) {
/*
* Don't let another task, with possibly unlocked vma,
* keep the mlocked page.
*/
if ((ret & VM_FAULT_WRITE) && (vma->vm_flags & VM_LOCKED)) {
lock_page(old_page); /* LRU manipulation */
munlock_vma_page(old_page);
unlock_page(old_page);
}
page_cache_release(old_page);
}
return ret;
oom_free_new:
page_cache_release(new_page);
Expand Down

0 comments on commit a8afba6

Please sign in to comment.