Commit c2fda5fe authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Linus Torvalds

[PATCH] Fix up page_mkclean_one(): virtual caches, s390

 - add flush_cache_page() for all those virtual indexed cache
   architectures.

 - handle s390.
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e21654a7
...@@ -433,7 +433,7 @@ static int page_mkclean_one(struct page *page, struct vm_area_struct *vma) ...@@ -433,7 +433,7 @@ static int page_mkclean_one(struct page *page, struct vm_area_struct *vma)
{ {
struct mm_struct *mm = vma->vm_mm; struct mm_struct *mm = vma->vm_mm;
unsigned long address; unsigned long address;
pte_t *pte, entry; pte_t *pte;
spinlock_t *ptl; spinlock_t *ptl;
int ret = 0; int ret = 0;
...@@ -445,17 +445,18 @@ static int page_mkclean_one(struct page *page, struct vm_area_struct *vma) ...@@ -445,17 +445,18 @@ static int page_mkclean_one(struct page *page, struct vm_area_struct *vma)
if (!pte) if (!pte)
goto out; goto out;
if (!pte_dirty(*pte) && !pte_write(*pte)) if (pte_dirty(*pte) || pte_write(*pte)) {
goto unlock; pte_t entry;
entry = ptep_get_and_clear(mm, address, pte); flush_cache_page(vma, address, pte_pfn(*pte));
entry = pte_mkclean(entry); entry = ptep_clear_flush(vma, address, pte);
entry = pte_wrprotect(entry); entry = pte_wrprotect(entry);
ptep_establish(vma, address, pte, entry); entry = pte_mkclean(entry);
set_pte_at(vma, address, pte, entry);
lazy_mmu_prot_update(entry); lazy_mmu_prot_update(entry);
ret = 1; ret = 1;
}
unlock:
pte_unmap_unlock(pte, ptl); pte_unmap_unlock(pte, ptl);
out: out:
return ret; return ret;
...@@ -490,6 +491,8 @@ int page_mkclean(struct page *page) ...@@ -490,6 +491,8 @@ int page_mkclean(struct page *page)
if (mapping) if (mapping)
ret = page_mkclean_file(mapping, page); ret = page_mkclean_file(mapping, page);
} }
if (page_test_and_clear_dirty(page))
ret = 1;
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment