lkml.org 
[lkml]   [2022]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1] mm/vmscan: check the return value of migrate_pages()
From
Hi,

On 9/17/2022 10:12 AM, Li Zhong wrote:
> Check the return value of migrate_pages() to check error exeuction.
>
> Signed-off-by: Li Zhong <floridsleeves@gmail.com>
> ---
> mm/vmscan.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index b2b1431352dc..50aaaa9377e2 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1547,6 +1547,7 @@ static unsigned int demote_page_list(struct list_head *demote_pages,
> {
> int target_nid = next_demotion_node(pgdat->node_id);
> unsigned int nr_succeeded;
> + int ret;
>
> if (list_empty(demote_pages))
> return 0;
> @@ -1555,10 +1556,13 @@ static unsigned int demote_page_list(struct list_head *demote_pages,
> return 0;
>
> /* Demotion ignores all cpuset and mempolicy settings */
> - migrate_pages(demote_pages, alloc_demote_page, NULL,
> + ret = migrate_pages(demote_pages, alloc_demote_page, NULL,
> target_nid, MIGRATE_ASYNC, MR_DEMOTION,
> &nr_succeeded);
>
> + if (ret)
> + putback_movable_pages(&pagelist);

You can not just put them back into the original lru list, instead the
caller has handled the failed-to-demote pages, which will try to reclaim
them.

In addition, the code cannot even be built successfully.

\
 
 \ /
  Last update: 2022-09-21 12:43    [W:0.020 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site