[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <257f4e4b-aaab-824c-9a68-6dc88d7f988f@huawei.com>
Date: Tue, 8 Mar 2022 14:34:17 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: Baolin Wang <baolin.wang@...ux.alibaba.com>,
<akpm@...ux-foundation.org>
CC: <mike.kravetz@...cle.com>, <shy828301@...il.com>,
<willy@...radead.org>, <ying.huang@...el.com>, <ziy@...dia.com>,
<minchan@...nel.org>, <apopple@...dia.com>,
<ave.hansen@...ux.intel.com>, <o451686892@...il.com>,
<almasrymina@...gle.com>, <jhubbard@...dia.com>,
<rcampbell@...dia.com>, <peterx@...hat.com>,
<naoya.horiguchi@....com>, <mhocko@...e.com>, <riel@...hat.com>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 13/16] mm/migration: return errno when isolate_huge_page
failed
On 2022/3/8 9:32, Baolin Wang wrote:
>
>
> On 3/7/2022 8:20 PM, Miaohe Lin wrote:
>> On 2022/3/7 10:14, Baolin Wang wrote:
>>> 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@...wei.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.
>>
>> IIUC, this could happen when hugepage is under migration which cleared HPageMigratable. Page refcnt cannot
>> prevent isolate_huge_page from happening. Or am I miss something?
>
> Yes, that's possible. Thanks for your explanation. It will be better if you can copy the possible scenario description to the commit log to help other understand the issue.
>
Sounds reasonable. Will do. Many thanks for review.
> Reviewed-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
> .
Powered by blists - more mailing lists