Re: [PATCH v2 11/11] mm/migration: fix possible do_pages_stat_array racing with memory offline

From: Muchun Song
Date: Fri Mar 18 2022 - 03:01:50 EST


On Thu, Mar 17, 2022 at 10:42 PM Miaohe Lin <linmiaohe@xxxxxxxxxx> wrote:
>
> When follow_page peeks a page, the page could be migrated and then be
> offlined while it's still being used by the do_pages_stat_array().
> Use FOLL_GET to hold the page refcnt to fix this potential race.
>
> Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>

Reviewed-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>