public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* zap_page_range(): TLB flush race
@ 2000-04-08 20:06 Manfred Spraul
  2000-04-08 21:11 ` Kanoj Sarcar
  0 siblings, 1 reply; 19+ messages in thread
From: Manfred Spraul @ 2000-04-08 20:06 UTC (permalink / raw)
  To: linux-kernel, linux-mm

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/

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

end of thread, other threads:[~2000-04-12 10:08 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-04-08 20:06 zap_page_range(): TLB flush race Manfred Spraul
2000-04-08 21:11 ` Kanoj Sarcar
2000-04-08 22:46   ` Manfred Spraul
2000-04-08 23:31     ` Kanoj Sarcar
2000-04-08 23:37       ` Alan Cox
2000-04-08 23:54         ` Kanoj Sarcar
2000-04-09  9:10         ` Manfred Spraul
2000-04-09  9:19           ` David S. Miller
2000-04-10 22:21         ` Stephen C. Tweedie
2000-04-10 23:12           ` David S. Miller
2000-04-11  9:14             ` Stephen C. Tweedie
2000-04-11 14:41               ` Manfred Spraul
2000-04-11 16:40                 ` Andrea Arcangeli
2000-04-11 17:45                   ` Manfred Spraul
2000-04-11 18:14                     ` Kanoj Sarcar
2000-04-12 10:02                     ` Jamie Lokier
2000-04-11 11:56           ` Alan Cox
2000-04-08 23:44   ` David S. Miller
2000-04-09  0:20     ` Kanoj Sarcar

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