Re: [PATCH] mm: migrate: make demotion knob depend on migration

From: Huang, Ying
Date: Thu Oct 14 2021 - 21:42:29 EST


Yang Shi <shy828301@xxxxxxxxx> writes:

> The memory demotion needs to call migrate_pages() to do the jobs. And
> it is controlled by a knob, however, the knob doesn't depend on
> CONFIG_MIGRATION. The knob could be truned on even though MIGRATION is
> disabled, this will not cause any crash since migrate_pages() would just
> return -ENOSYS. But it is definitely not optimal to go through demotion
> path then retry regular swap every time.
>
> And it doesn't make too much sense to have the knob visible to the users
> when !MIGRATION. Move the related code from mempolicy.[h|c] to migrate.[h|c].

Sounds reasonable to me. Thanks!

> Signed-off-by: Yang Shi <shy828301@xxxxxxxxx>

Acked-by: "Huang, Ying" <ying.huang@xxxxxxxxx>

Best Regards,
Huang, Ying