On Thu, 2006-12-21 at 10:16 +0100, Martin Schwidefsky wrote: > On Thu, 2006-12-21 at 00:03 +0100, Peter Zijlstra wrote: > > current version > > Nitpicking .. > > > @@ -444,17 +444,18 @@ static int page_mkclean_one(struct page > > if (!pte) > > goto out; > > > > - if (!pte_dirty(*pte) && !pte_write(*pte)) > > - goto unlock; > > + while (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); > > + ptep_establish(vma, address, pte, entry); > > Now you are flushing the tlb twice. ptep_clear_flush clears the pte and > flushes the tlb, ptep_establish sets the new pte and flushes the tlb. > Not good. Use set_pte_at instead of the ptep_establish. Yeah, sorry, I already noticed and corrected that :-| Also, I'm dubious about the while thing and stuck a WARN_ON(ret) thing at the beginning of the loop. flush_tlb_page() does IPI the other cpus to flush their tlb too, so there should not be a SMP race, Arjan? > > + lazy_mmu_prot_update(entry); > > + ret = 1; > > + } > > > > -unlock: > > pte_unmap_unlock(pte, ptl); > > out: > > return ret; > - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Martin Schwidefsky <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- References:
- Re: 2.6.19 file content corruption on ext3
- From: Linus Torvalds <[email protected]>
- Re: 2.6.19 file content corruption on ext3
- From: Peter Zijlstra <[email protected]>
- Re: 2.6.19 file content corruption on ext3
- From: Linus Torvalds <[email protected]>
- Re: 2.6.19 file content corruption on ext3
- From: Peter Zijlstra <[email protected]>
- Re: 2.6.19 file content corruption on ext3
- From: Arjan van de Ven <[email protected]>
- [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Hugh Dickins <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Martin Michlmayr <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Martin Michlmayr <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Peter Zijlstra <[email protected]>
- Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- From: Martin Schwidefsky <[email protected]>
- Re: 2.6.19 file content corruption on ext3
- Prev by Date: [take28-resend_1->0 4/8] kevent: Socket notifications.
- Next by Date: Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- Previous by thread: Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- Next by thread: Re: [PATCH] mm: fix page_mkclean_one (was: 2.6.19 file content corruption on ext3)
- Index(es):