From: Miaohe Lin <linmiaohe@huawei.com>
To: Oscar Salvador <osalvador@suse.de>, David Hildenbrand <david@redhat.com>
Cc: <akpm@linux-foundation.org>, <shy828301@gmail.com>,
<nao.horiguchi@gmail.com>, <xuyu@linux.alibaba.com>,
<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mm/huge_memory: don't unpoison huge_zero_folio
Date: Thu, 16 May 2024 16:45:22 +0800 [thread overview]
Message-ID: <fd1b4d3f-be4c-16e2-00d9-8ea6443c68f3@huawei.com> (raw)
In-Reply-To: <ZkXDS9y_cBSzBzeN@localhost.localdomain>
On 2024/5/16 16:26, Oscar Salvador wrote:
> On Wed, May 15, 2024 at 05:55:39PM +0200, David Hildenbrand wrote:
>>> + if (is_huge_zero_folio(folio)) {
>>> + unpoison_pr_info("Unpoison: huge zero page is not supported %#lx\n",
>>> + pfn, &unpoison_rs);
>>> + goto unlock_mutex;
>>> + }
>>> +
>
> Sorry for spamming your reply David, but for some unknown reason I am not able
> to find the original patch in my mailbox, in none of the two accountes I am
> subscribed, so I guess I will have to reply here.
>
> Just two things
>
> 1) We do not care if someone grabs a refcount for huge_zero_folio,
> because since it is not supported anyway the outcome will not change.
> Also, AFAIK, there is no chance we can unpoison that folio.
> Therefore, I would just lift the check two blocks and place it right after
> the hw_memory_failure check.
>
> 2) The whole thing is unsupported, but you will return -EBUSY while you
> should be returning -EOPNOTSUPP AFAICS.
>
Thanks for your comment. Do you mean something like below?
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 16ada4fb02b7..a9fe9eda593f 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -2546,6 +2546,13 @@ int unpoison_memory(unsigned long pfn)
goto unlock_mutex;
}
+ if (is_huge_zero_folio(folio)) {
+ unpoison_pr_info("Unpoison: huge zero page is not supported %#lx\n",
+ pfn, &unpoison_rs);
+ ret = -EOPNOTSUPP;
+ goto unlock_mutex;
+ }
+
if (!PageHWPoison(p)) {
unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n",
pfn, &unpoison_rs);
Thanks.
.
> with that you can add:
>
> Reviewed-by: Oscar Salvador <osalvador@suse.de>
>
>
>
next prev parent reply other threads:[~2024-05-16 8:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 2:36 [PATCH v2] mm/huge_memory: don't unpoison huge_zero_folio Miaohe Lin
2024-05-15 15:55 ` David Hildenbrand
2024-05-16 8:26 ` Oscar Salvador
2024-05-16 8:45 ` Miaohe Lin [this message]
2024-05-16 9:07 ` Oscar Salvador
2024-05-15 15:58 ` Yang Shi
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=fd1b4d3f-be4c-16e2-00d9-8ea6443c68f3@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=nao.horiguchi@gmail.com \
--cc=osalvador@suse.de \
--cc=shy828301@gmail.com \
--cc=xuyu@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.