From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 11 Sep 2000 22:56:43 -0300 (BRST) From: Rik van Riel Subject: Re: [PATCH] workaround for lost dirty bits on x86 SMP In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: bcrl@redhat.com Cc: Kanoj Sarcar , linux-mm@kvack.org, torvalds@transmeta.com List-ID: On Mon, 11 Sep 2000 bcrl@redhat.com wrote: > On Mon, 11 Sep 2000, Kanoj Sarcar wrote: > > > One of the worst races is in the page stealing path, when the stealer > > thread checks whether the page is dirty, decides to pte_clear(), and > > right then, the user dirties the pte, before the stealer thread has done > > the flush_tlb. Are you trying to handle this situation? > > That's the one. It also crops up in msync, munmap and such. And (IMHO the worst one) in try_to_swap_out... 55 if (pte_young(pte)) { 56 /* 57 * Transfer the "accessed" bit from the page 58 * tables to the global page map. 59 */ 60 set_pte(page_table, pte_mkold(pte)); Imagine what would happen if the CPU would mark a page dirty while we are here... CPU#0: CPU#1: (kswapd) (user process) read pte ... replace TLB entry / write dirty bit set_pte() And we've lost the dirty bit ... regards, Rik -- "What you're running that piece of shit Gnome?!?!" -- Miguel de Icaza, UKUUG 2000 http://www.conectiva.com/ http://www.surriel.com/ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/