I think I am still on thin ice with this patchset but its reasonably simple now and I hope that the simplification by removing the unwind code and the migration of swapcache pages is something that turns out to be workable. I have tested with some simple test programs here that definitely are not able to produce all potential troublesome scenarios. This patchset depends on V4 of the Swap Migration patchset. It implements direct page migration on top of that patchset with the same APIs supported by the swap migration patchset. The patchset consists of three patches: 1. SWAP_REFERENCE try_to_unmap pages currently does not distinguish between a failure due to a really unswappable page and a failure due to the page having just been referenced. The patch adds another exit code allowing the detection of failure due to a recently referenced page. In that case the page migration code may want to immediately retry again. 2. Direct page migration This patch extends the migrate_pages() function to support direct page migration. Limitation: No support for migrating dirty pages backed by files. SwapCache pages are swapped out. Generally fall back to swap if necessary. 3. Policy layer update This adds support for direct page migration to the memory policy layer. It adds the capability to sys_migrate to do a staggered move of pages.