lkml.org 
[lkml]   [2022]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 13/16] mm/migration: return errno when isolate_huge_page failed
From
Hi Miaohe,

On 3/4/2022 5:34 PM, Miaohe Lin wrote:
> We should return errno (-EBUSY here) when failed to isolate the huge page
> rather than always return 1 which could confuse the user.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> mm/migrate.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 6c2dfed2ddb8..279940c0c064 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -1618,10 +1618,8 @@ static int add_page_for_migration(struct mm_struct *mm, unsigned long addr,
> goto out_putpage;
>
> if (PageHuge(page)) {
> - if (PageHead(page)) {
> - isolate_huge_page(page, pagelist);
> - err = 1;
> - }
> + if (PageHead(page))
> + err = isolate_huge_page(page, pagelist) ? 1 : -EBUSY;

Could you elaborate on which case the huge page isolation can be failed
in this case? Or you met a real problem? Cause now we've got this head
huge page refcnt, I can not see why we'll fail to isolate this huge page.

\
 
 \ /
  Last update: 2022-03-07 03:15    [W:0.342 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site