Re: [PATCH 0/3] Fix migration races in rmap_walk() V2
From: Christoph Lameter
Date: Tue Apr 27 2010 - 18:29:10 EST
On Tue, 27 Apr 2010, Mel Gorman wrote:
> The problem is that there are some races that either allow migration PTEs to
> be copied or a migration PTE to be left behind. Migration still completes and
> the page is unlocked but later a fault will call migration_entry_to_page()
> and BUG() because the page is not locked. This series aims to close some
> of these races.
In general migration ptes were designed to cause the code encountering
them to go to sleep until migration is finished and a regular pte is
available. Looks like we are tolerating the handling of migration entries.
Never imagined copying page table with this. There could be recursion
issues of various kinds because page migration requires operations on the
page tables while performing migration. A simple fix would be to *not*
migrate page table tables.
> Patch 1 alters fork() to restart page table copying when a migration PTE is
> encountered.
Can we simply wait like in the fault path?
> Patch 3 notes that while a VMA is moved under the anon_vma lock, the page
> tables are not similarly protected. Where migration PTEs are
> encountered, they are cleaned up.
This means they are copied / moved etc and "cleaned" up in a state when
the page was unlocked. Migration entries are not supposed to exist when
a page is not locked.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/