linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Li Zhong <floridsleeves@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: akpm@linux-foundation.org
Subject: Re: [PATCH v1] mm/vmscan: check the return value of migrate_pages()
Date: Wed, 21 Sep 2022 18:42:24 +0800	[thread overview]
Message-ID: <5b74c435-6dec-4346-e237-ad36bfcb9789@linux.alibaba.com> (raw)
In-Reply-To: <20220917021257.3840548-1-floridsleeves@gmail.com>

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.


      parent reply	other threads:[~2022-09-21 10:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17  2:12 Li Zhong
2022-09-17  4:15 ` kernel test robot
2022-09-17  4:25 ` kernel test robot
2022-09-21 10:42 ` Baolin Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b74c435-6dec-4346-e237-ad36bfcb9789@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=floridsleeves@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox