[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5a4fd4a3-da5c-5e83-c36b-4de0d9dce903@huawei.com>
Date: Tue, 6 Sep 2022 09:07:16 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: HORIGUCHI NAOYA (堀口 直也)
<naoya.horiguchi@....com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/6] mm, hwpoison: use __PageMovable() to detect non-lru
movable pages
On 2022/9/6 5:53, Andrew Morton wrote:
> On Mon, 5 Sep 2022 15:29:34 +0800 Miaohe Lin <linmiaohe@...wei.com> wrote:
>
>> The above code change could be applied to the mm-tree directly. Or should I resend
>> the v2 series? Which one is more convenient for you? They're all fine to me. ;)
>
> I got it, thanks.
Many thanks for doing this. That's very kind of you.
Thanks,
Miaohe Lin
>
> From: Miaohe Lin <linmiaohe@...wei.com>
> Subject: mm-hwpoison-use-__pagemovable-to-detect-non-lru-movable-pages-fix
> Date: Mon, 5 Sep 2022 14:53:41 +0800
>
> fixes per Naoya Horiguchi
>
> Link: https://lkml.kernel.org/r/1f7ee86e-7d28-0d8c-e0de-b7a5a94519e8@huawei.com
> Cc: Naoya Horiguchi <naoya.horiguchi@....com>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
>
> mm/memory-failure.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> --- a/mm/memory-failure.c~mm-hwpoison-use-__pagemovable-to-detect-non-lru-movable-pages-fix
> +++ a/mm/memory-failure.c
> @@ -2404,24 +2404,26 @@ EXPORT_SYMBOL(unpoison_memory);
> static bool isolate_page(struct page *page, struct list_head *pagelist)
> {
> bool isolated = false;
> - bool lru = !__PageMovable(page);
>
> if (PageHuge(page)) {
> isolated = !isolate_hugetlb(page, pagelist);
> } else {
> + bool lru = !__PageMovable(page);
> +
> if (lru)
> isolated = !isolate_lru_page(page);
> else
> - isolated = !isolate_movable_page(page, ISOLATE_UNEVICTABLE);
> + isolated = !isolate_movable_page(page,
> + ISOLATE_UNEVICTABLE);
>
> - if (isolated)
> + if (isolated) {
> list_add(&page->lru, pagelist);
> + if (lru)
> + inc_node_page_state(page, NR_ISOLATED_ANON +
> + page_is_file_lru(page));
> + }
> }
>
> - if (isolated && lru)
> - inc_node_page_state(page, NR_ISOLATED_ANON +
> - page_is_file_lru(page));
> -
> /*
> * If we succeed to isolate the page, we grabbed another refcount on
> * the page, so we can safely drop the one we got from get_any_pages().
> _
>
> .
>
Powered by blists - more mailing lists