Re: [PATCH -V11 4/9] mm/migrate: demote pages during reclaim

From: Zi Yan
Date: Wed Jul 21 2021 - 17:11:31 EST


On 21 Jul 2021, at 2:39, Huang Ying wrote:

> From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>
> This is mostly derived from a patch from Yang Shi:
>
> https://lore.kernel.org/linux-mm/1560468577-101178-10-git-send-email-yang.shi@xxxxxxxxxxxxxxxxx/
>
> 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@xxxxxxxxx
> Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Signed-off-by: "Huang, Ying" <ying.huang@xxxxxxxxx>
> Reviewed-by: Yang Shi <shy828301@xxxxxxxxx>
> Reviewed-by: Wei Xu <weixugc@xxxxxxxxxx>
> Reviewed-by: Oscar Salvador <osalvador@xxxxxxx>
> Cc: Michal Hocko <mhocko@xxxxxxxx>
> Cc: Zi Yan <ziy@xxxxxxxxxx>
> Cc: David Rientjes <rientjes@xxxxxxxxxx>
> Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
> Cc: David Hildenbrand <david@xxxxxxxxxx>
> Cc: Greg Thelen <gthelen@xxxxxxxxxx>
> Cc: Keith Busch <kbusch@xxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> ---
> 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 <ziy@xxxxxxxxxx>


Best Regards,
Yan, Zi

Attachment: signature.asc
Description: OpenPGP digital signature