On Fri, Nov 07, 2014 at 08:52:10AM +0000, Mel Gorman wrote: > On Thu, Nov 06, 2014 at 05:48:16PM +0000, Wei Liu wrote: > > In b38af4721 ("x86,mm: fix pte_special versus pte_numa") pte_special() > > (SPECIAL with PRESENT or PROTNONE) was made to complement pte_numa() > > (SPECIAL with neither PRESENT nor PROTNONE). That broke Xen PV guest > > with NUMA balancing support. > > > > That's because Xen hypervisor sets _PAGE_GLOBAL (_PAGE_GLOBAL / > > _PAGE_PROTNONE in Linux) for guest user space mapping. So in a Xen PV > > guest, when NUMA balancing is enabled, a NUMA hinted PTE ends up > > "SPECIAL (in fact NUMA) with PROTNONE but not PRESENT", which makes > > pte_special() returns true when it shouldn't. > > > > Fundamentally we only need _PAGE_NUMA and _PAGE_PRESENT to tell > > difference between an unmapped entry and an entry protected for NUMA > > hinting fault. So use _PAGE_BIT_SOFTW2 as _PAGE_BIT_NUMA, adjust > > _PAGE_NUMA_MASK and SWP_OFFSET_SHIFT as needed. > > > > Suggested-by: David Vrabel <david.vrabel@xxxxxxxxxx> > > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> > > I suggest instead that you force automatic NUMA balancing to be disabled > on Xen PV guests until I or someone else finds time to implement Linus' > idea to remove _PAGE_NUMA entirely. It's been on my TODO list for a few > weeks but I still have not reached the point where I'm back working on > upstream material properly. > No problem. Thanks for the suggestion. Wei. > -- > Mel Gorman > SUSE Labs -- 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>