> This series of patches implements page migration in the fault path. > > !!! N.B., Need to consider iteraction with KSM and Transparent Huge > !!! Pages. > > The basic idea is that when a fault handler such as do_swap_page() > finds a cached page with zero mappings that is otherwise "stable"-- > e.g., no I/O in progress--this is a good opportunity to check whether the > page resides on the node indicated by the mempolicy in the current context. > > We only attempt to migrate when there are zero mappings because 1) we can > easily migrate the page--don't have to go through the effort of removing > all mappings and 2) default policy--a common case--can give different > answers from different tasks running on different nodes. Checking the > policy when there are zero mappings effectively implements a "first touch" > placement policy. > > Note that this mechanism could be used to migrate page cache pages that > were read in earlier, are no longer referenced, but are about to be > used by a new task on another node from where the page resides. The > same mechanism can be used to pull anon pages along with a task when > the load balancer decides to move it to another node. However, that > will require a bit more mechanism, and is the subject of another > patch series. > > The kernel's direct migration facility support most of the > mechanism that is required to implement this "migration on fault". > Some changes were needed to the migratepage op functions to behave > appropriately when called from the fault path. Then we need to add > the function[s] to test the current page in the fault path for zero > mapping, no writebacks, misplacement, ...; and the > function[s] to acutally migrate the page contents to a newly > allocated page using the [modified] migratepage address space > operations of the direct migration mechanism. > > This series used to include patches to migrate cached file pages and > shmem pages. Testing with, e.g., kernel builds, showed a great deal > of thrashing of page cache pages, so those patches have been removed. > I think page replication would be a better approach for shared, > read-only pages. Nick Piggin created such a patch quite a while back > and I had integrated it with automigration series. Those patches have > since gone stale. Nice! This is very useful for HPC area and Solaris already has similar feature. (madvise(MADV_ACCESS_LWP)). I believe it is useful even though it has not been integrated KSM and THP. Side note: Another similar trial is here. http://lwn.net/Articles/332754/ And I can easily found some background theory paper by quck googling. http://www.compunity.org/events/pastevents/ewomp2004/loef_holmgren_pap_ew04.pdf Lee, can you please update Documentaion/? espesially MPOL_MF_LAZY and MPOL_MF_NOOP need to be, I think. -- To unsubscribe from this list: send the line "unsubscribe linux-numa" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html