From: Miaohe Lin <linmiaohe@huawei.com>
To: David Hildenbrand <david@redhat.com>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
<naoya.horiguchi@nec.com>, <shy828301@gmail.com>,
<mike.kravetz@oracle.com>
Subject: Re: [PATCH v3 2/2] mm/memory-failure.c: make non-LRU movable pages unhandlable
Date: Fri, 18 Mar 2022 14:28:33 +0800 [thread overview]
Message-ID: <6f613668-6cc8-13eb-df81-1bfc3d9e6f22@huawei.com> (raw)
In-Reply-To: <9f26eccb-d0f3-1c00-dce1-ab7fdd439fbb@redhat.com>
On 2022/3/17 20:11, David Hildenbrand wrote:
> On 18.03.22 08:39, Miaohe Lin wrote:
>> We can not really handle non-LRU movable pages in memory failure. Typically
>> they are balloon, zsmalloc, etc. Assuming we run into a base (4K) non-LRU
>> movable page, we could reach as far as identify_page_state(), it should not
>> fall into any category except me_unknown. For the non-LRU compound movable
>> pages, they could be taken for transhuge pages but it's unexpected to split
>> non-LRU movable pages using split_huge_page_to_list in memory_failure. So
>> we could just simply make non-LRU movable pages unhandlable to avoid these
>> possible nasty cases.
>>
>> Suggested-by: Yang Shi <shy828301@gmail.com>
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>> Reviewed-by: Yang Shi <shy828301@gmail.com>
>> Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
>> ---
>> mm/memory-failure.c | 20 +++++++++++++-------
>> 1 file changed, 13 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
>> index ecf45961f3b6..bf14bea2ed93 100644
>> --- a/mm/memory-failure.c
>> +++ b/mm/memory-failure.c
>> @@ -1176,12 +1176,18 @@ void ClearPageHWPoisonTakenOff(struct page *page)
>> * does not return true for hugetlb or device memory pages, so it's assumed
>> * to be called only in the context where we never have such pages.
>> */
>> -static inline bool HWPoisonHandlable(struct page *page)
>> +static inline bool HWPoisonHandlable(struct page *page, unsigned long flags)
>> {
>> - return PageLRU(page) || __PageMovable(page) || is_free_buddy_page(page);
>> + bool movable = false;
>> +
>> + /* Soft offline could mirgate non-LRU movable pages */
>
> s/mirgate/migrate/
OK. My mistake.
>
>> + if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page))
>> + movable = true;
>
> simply "return true" and drop "bool movable".
OK.
>
>> +
>> + return movable || PageLRU(page) || is_free_buddy_page(page);
>
Many thanks for comment!
prev parent reply other threads:[~2022-03-18 6:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 7:39 [PATCH v3 0/2] A few fixup patches for memory failure Miaohe Lin
2022-03-18 7:39 ` [PATCH v3 1/2] mm/memory-failure.c: avoid calling invalidate_inode_page() with unexpected pages Miaohe Lin
2022-03-17 12:29 ` David Hildenbrand
2022-03-18 6:29 ` Miaohe Lin
2022-03-18 7:39 ` [PATCH v3 2/2] mm/memory-failure.c: make non-LRU movable pages unhandlable Miaohe Lin
2022-03-17 12:11 ` David Hildenbrand
2022-03-18 6:28 ` Miaohe Lin [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=6f613668-6cc8-13eb-df81-1bfc3d9e6f22@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=naoya.horiguchi@nec.com \
--cc=shy828301@gmail.com \
/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
all inboxes | Powered by JetHome®