On Thu, Apr 1, 2021 at 11:35 AM Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> wrote: > This proposes extending the existing "zone_reclaim_mode" (now > now really node_reclaim_mode) as a method to enable it. Nit: now now -> now > We are open to any alternative that allows end users to enable > this mechanism or disable it it workload harm is detected (just > like traditional autonuma). Nit: it it -> it if > diff -puN mm/vmscan.c~RECLAIM_MIGRATE mm/vmscan.c > --- a/mm/vmscan.c~RECLAIM_MIGRATE 2021-03-31 15:17:40.339000190 -0700 > +++ b/mm/vmscan.c 2021-03-31 15:17:40.357000190 -0700 > @@ -1074,6 +1074,9 @@ static bool migrate_demote_page_ok(struc > VM_BUG_ON_PAGE(PageHuge(page), page); > VM_BUG_ON_PAGE(PageLRU(page), page); > > + if (!(node_reclaim_mode & RECLAIM_MIGRATE)) > + return false; > + As I commented on an earlier patch in this series, the RECLAIM_MIGRATE check needs to be added to other new callers of next_demotion_node() as well to avoid unnecessarily splitting THP pages when neither swap nor RECLAIM_MIGRATE is enabled. It can be too late to check RECLAIM_MIGRATE only in migrate_demote_page_ok().