public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* BUG: about flush TLB during unmapping a page in memory subsystem
@ 2006-10-20  2:47 yunfeng zhang
  2006-10-20  3:02 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: yunfeng zhang @ 2006-10-20  2:47 UTC (permalink / raw)
  To: linux-kernel

In rmap.c::try_to_unmap_one of 2.6.16.29, there are some code snippets

.....
/* Nuke the page table entry. */
flush_cache_page(vma, address, page_to_pfn(page));
pteval = ptep_clear_flush(vma, address, pte);
// >>> The above line is expanded as below
// >>> pte_t __pte;
// >>> __pte = ptep_get_and_clear((__vma)->vm_mm, __address, __ptep);
// >>> flush_tlb_page(__vma, __address);
// >>> __pte;

/* Move the dirty bit to the physical page now the pte is gone. */
if (pte_dirty(pteval))
        set_page_dirty(page);
.....


It seems that they only can work on UP system.

On SMP, let's suppose the pte was clean, after A CPU executed
ptep_get_and_clear,
B CPU makes the pte dirty, which will make a fatal error to A CPU since it gets
a stale pte, isn't right?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-10-20  5:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-20  2:47 BUG: about flush TLB during unmapping a page in memory subsystem yunfeng zhang
2006-10-20  3:02 ` David Miller
2006-10-20  5:10   ` yunfeng zhang
2006-10-20  5:54     ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox