zap_page_range(): TLB flush race

From: Manfred Spraul (manfreds@colorfullife.com)
Date: Sat Apr 08 2000 - 15:06:13 EST


it seems we have a smp race in zap_page_range():

When we remove a page from the page tables, we must call:

        flush_cache_page();
        pte_clear();
        flush_tlb_page();
        free_page();

We must not free the page before we have called flush_tlb_xy(),
otherwise the second cpu could access memory that already freed.

but zap_page_range() calls free_page() before the flush_tlb() call.

Is that really a bug, has anyone a good idea how to fix that?

filemap_sync() calls flush_tlb_page() for each page, but IMHO this is a
really bad idea, the performance will suck with multi-threaded apps on
SMP.

Perhaps build a linked list, and free later?
We could abuse the next pointer from "struct page".

--
	Manfred

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:11 EST