@@ -369,11 +369,22 @@ typedef struct { signed long pd; } hugepd_t;
#ifdef CONFIG_PPC_BOOK3S_64
static inline int hugepd_ok(hugepd_t hpd)
{
+#ifdef CONFIG_NUMA_BALANCING
+ /*
+ * In order to enable batch handling of pte numa faults, Numa balancing
+ * code use the _PAGE_NUMA bit even on pmd that is pointing to PTE PAGE.
+ * 9532fec118d485ea37ab6e3ea372d68cd8b4cd0d. After commit
+ * e2b3d202d1dba8f3546ed28224ce485bc50010be we really don't need to
+ * support hugepd for ppc64.
+ */
+ return 0;
+#else
/*
* hugepd pointer, bottom two bits == 00 and next 4 bits
* indicate size of table
*/
return (((hpd.pd & 0x3) == 0x0) && ((hpd.pd & HUGEPD_SHIFT_MASK) != 0));
+#endif
}
#else
static inline int hugepd_ok(hugepd_t hpd)
@@ -235,8 +235,14 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz
if (!hpdp)
return NULL;
+#ifdef CONFIG_NUMA_BALANCING
+ /*
+ * We cannot support hugepd format with numa balancing support
+ * enabled.
+ */
+ return NULL;
+#endif
BUG_ON(!hugepd_none(*hpdp) && !hugepd_ok(*hpdp));
-
if (hugepd_none(*hpdp) && __hugepte_alloc(mm, hpdp, addr, pdshift, pshift))
return NULL;