On 12/09/2013 11:59 AM, Christoph Lameter wrote: > On Mon, 9 Dec 2013, Mel Gorman wrote: > >> I looked at what would be required to implement migration entry support for >> PMDs. It's major surgery because we do not have something like swap-like >> entries to use at that page table level. It looked like it would require >> inserting a fake entry (easiest would be to point to a global page) that >> all page table walkers would recognise, blocking on it and teaching every >> page table walker to get it right. > > Well something needs to cause a fault and stop accesses to the page. The NUMA patches introduce such a state: the pmd_numa state. The "issue" is that the NUMA code can race with itself, and with CMA. The code that markes PMDs as NUMA ones will change a bunch of PMDs at once, and will then flush the TLB. Until that flush, CPUs that have the old translation cached in their TLBs may continue accessing the page. Meanwhile, the code that does the migration may start running on a CPU that does not have an old entry in the TLB, and it may start the page migration. The fundamental issue is that moving the PMD state from valid to the intermediate state consists of multiple operations, and there will always be some time window between them. -- All rights reversed -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>