Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx> writes: > LAST_CPUPID_MASK is calculated using LAST_CPUPID_WIDTH. However > LAST_CPUPID_WIDTH itself can be 0. (when LAST_CPUPID_NOT_IN_PAGE_FLAGS > is set). In such a case LAST_CPUPID_MASK turns out to be 0. > > But with recent commit 1ae71d0319: (mm: numa: bugfix for > LAST_CPUPID_NOT_IN_PAGE_FLAGS) if LAST_CPUPID_MASK is 0, > page_cpupid_xchg_last() and page_cpupid_reset_last() causes > page->_last_cpupid to be set to 0. > > This causes performance regression. Its almost as if numa_balancing is > off. > > Fix LAST_CPUPID_MASK by using LAST_CPUPID_SHIFT instead of > LAST_CPUPID_WIDTH. > > Signed-off-by: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx> > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index c1b7414..b9765bf 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -684,7 +684,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) > #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) > #define NODES_MASK ((1UL << NODES_WIDTH) - 1) > #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) > -#define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_WIDTH) - 1) > +#define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_SHIFT) - 1) > #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) > > static inline enum zone_type page_zonenum(const struct page *page) > > -- > 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> -- 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>