Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44918
b: refs/heads/master
c: c2fda5f
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Linus Torvalds committed Dec 22, 2006
1 parent 3a48930 commit 944a41d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 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: e21654a756177bf209d7a3cbe971f16104555f75
refs/heads/master: c2fda5fed81eea077363b285b66eafce20dfd45a
23 changes: 13 additions & 10 deletions trunk/mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ static int page_mkclean_one(struct page *page, struct vm_area_struct *vma)
{
struct mm_struct *mm = vma->vm_mm;
unsigned long address;
pte_t *pte, entry;
pte_t *pte;
spinlock_t *ptl;
int ret = 0;

Expand All @@ -445,17 +445,18 @@ static int page_mkclean_one(struct page *page, struct vm_area_struct *vma)
if (!pte)
goto out;

if (!pte_dirty(*pte) && !pte_write(*pte))
goto unlock;
if (pte_dirty(*pte) || pte_write(*pte)) {
pte_t entry;

entry = ptep_get_and_clear(mm, address, pte);
entry = pte_mkclean(entry);
entry = pte_wrprotect(entry);
ptep_establish(vma, address, pte, entry);
lazy_mmu_prot_update(entry);
ret = 1;
flush_cache_page(vma, address, pte_pfn(*pte));
entry = ptep_clear_flush(vma, address, pte);
entry = pte_wrprotect(entry);
entry = pte_mkclean(entry);
set_pte_at(vma, address, pte, entry);
lazy_mmu_prot_update(entry);
ret = 1;
}

unlock:
pte_unmap_unlock(pte, ptl);
out:
return ret;
Expand Down Expand Up @@ -490,6 +491,8 @@ int page_mkclean(struct page *page)
if (mapping)
ret = page_mkclean_file(mapping, page);
}
if (page_test_and_clear_dirty(page))
ret = 1;

return ret;
}
Expand Down

0 comments on commit 944a41d

Please sign in to comment.