On 21 Jul 2021, at 2:39, Huang Ying wrote: > From: Dave Hansen > > This is mostly derived from a patch from Yang Shi: > > https://lore.kernel.org/linux-mm/1560468577-101178-10-git-send-email-yang.shi@linux.alibaba.com/ > > Add code to the reclaim path (shrink_page_list()) to "demote" data to > another NUMA node instead of discarding the data. This always avoids the > cost of I/O needed to read the page back in and sometimes avoids the > writeout cost when the page is dirty. > > A second pass through shrink_page_list() will be made if any demotions > fail. This essentially falls back to normal reclaim behavior in the case > that demotions fail. Previous versions of this patch may have simply > failed to reclaim pages which were eligible for demotion but were unable > to be demoted in practice. > > For some cases, for example, MADV_PAGEOUT, the pages are always discarded > instead of demoted to follow the kernel API definition. Because > MADV_PAGEOUT is defined as freeing specified pages regardless in which > tier they are. > > Note: This just adds the start of infrastructure for migration. It is > actually disabled next to the FIXME in migrate_demote_page_ok(). > > Link: https://lkml.kernel.org/r/20210715055145.195411-5-ying.huang@intel.com > Signed-off-by: Dave Hansen > Signed-off-by: "Huang, Ying" > Reviewed-by: Yang Shi > Reviewed-by: Wei Xu > Reviewed-by: Oscar Salvador > Cc: Michal Hocko > Cc: Zi Yan > Cc: David Rientjes > Cc: Dan Williams > Cc: David Hildenbrand > Cc: Greg Thelen > Cc: Keith Busch > Signed-off-by: Andrew Morton > --- > include/linux/migrate.h | 9 ++++ > include/trace/events/migrate.h | 3 +- > mm/vmscan.c | 85 ++++++++++++++++++++++++++++++++++ > 3 files changed, 96 insertions(+), 1 deletion(-) > LGTM. Reviewed-by: Zi Yan — Best Regards, Yan, Zi