From: Miaohe Lin <linmiaohe@huawei.com>
To: Naoya Horiguchi <naoya.horiguchi@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
Mike Kravetz <mike.kravetz@oracle.com>,
Yang Shi <shy828301@gmail.com>,
Oscar Salvador <osalvador@suse.de>,
Muchun Song <songmuchun@bytedance.com>,
Naoya Horiguchi <naoya.horiguchi@nec.com>,
<linux-kernel@vger.kernel.org>, Linux-MM <linux-mm@kvack.org>
Subject: Re: [RFC PATCH v1 4/4] mm, memory_hotplug: fix inconsistent num_poisoned_pages on memory hotremove
Date: Thu, 28 Apr 2022 11:20:16 +0800 [thread overview]
Message-ID: <828cc111-40e8-88ed-bb50-fb185e5f0304@huawei.com> (raw)
In-Reply-To: <20220427042841.678351-5-naoya.horiguchi@linux.dev>
On 2022/4/27 12:28, Naoya Horiguchi wrote:
> From: Naoya Horiguchi <naoya.horiguchi@nec.com>
>
> When offlining memory section with hwpoisoned pages, the hwpoisons are
> canceled. But num_poisoned_pages is not updated for that event, so the
> counter becomes inconsistent.
IIUC, this work is already done via clear_hwpoisoned_pages when __remove_pages.
Or am I miss something?
Thanks!
>
> Add num_poisoned_pages_dec() in __offline_isolated_pages(). PageHWPoison
> can be set on a tail page of some high order buddy page, so we need check
> PageHWPoison on each subpage.
>
> Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
> ---
> mm/page_alloc.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 6e5b4488a0c5..dcd962855617 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -9487,12 +9487,15 @@ void __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
> zone = page_zone(pfn_to_page(pfn));
> spin_lock_irqsave(&zone->lock, flags);
> while (pfn < end_pfn) {
> + int i;
> +
> page = pfn_to_page(pfn);
> /*
> * The HWPoisoned page may be not in buddy system, and
> * page_count() is not 0.
> */
> if (unlikely(!PageBuddy(page) && PageHWPoison(page))) {
> + num_poisoned_pages_dec();
> pfn++;
> continue;
> }
> @@ -9510,6 +9513,9 @@ void __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
> BUG_ON(page_count(page));
> BUG_ON(!PageBuddy(page));
> order = buddy_order(page);
> + for (i = 0; i < 1 << order; i++)
> + if (PageHWPoison(page + i))
> + num_poisoned_pages_dec();
> del_page_from_free_list(page, zone, order);
> pfn += (1 << order);
> }
>
next prev parent reply other threads:[~2022-04-28 3:20 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 4:28 [RFC PATCH v1 0/4] mm, hwpoison: improve handling workload related to hugetlb and memory_hotplug Naoya Horiguchi
2022-04-27 4:28 ` [RFC PATCH v1 1/4] mm, hwpoison, hugetlb: introduce SUBPAGE_INDEX_HWPOISON to save raw error page Naoya Horiguchi
2022-04-27 7:11 ` Miaohe Lin
2022-04-27 13:03 ` HORIGUCHI NAOYA(堀口 直也)
2022-04-28 3:14 ` Miaohe Lin
2022-05-12 22:31 ` Jane Chu
2022-05-12 22:49 ` HORIGUCHI NAOYA(堀口 直也)
2022-04-27 4:28 ` [RFC PATCH v1 2/4] mm,hwpoison,hugetlb,memory_hotplug: hotremove memory section with hwpoisoned hugepage Naoya Horiguchi
2022-04-29 8:49 ` Miaohe Lin
2022-05-09 7:55 ` HORIGUCHI NAOYA(堀口 直也)
2022-05-09 8:57 ` Miaohe Lin
2022-04-27 4:28 ` [RFC PATCH v1 3/4] mm, hwpoison: add parameter unpoison to get_hwpoison_huge_page() Naoya Horiguchi
2022-04-27 4:28 ` [RFC PATCH v1 4/4] mm, memory_hotplug: fix inconsistent num_poisoned_pages on memory hotremove Naoya Horiguchi
2022-04-28 3:20 ` Miaohe Lin [this message]
2022-04-28 4:05 ` HORIGUCHI NAOYA(堀口 直也)
2022-04-28 7:16 ` Miaohe Lin
2022-05-09 13:34 ` Naoya Horiguchi
2022-04-27 10:48 ` [RFC PATCH v1 0/4] mm, hwpoison: improve handling workload related to hugetlb and memory_hotplug David Hildenbrand
2022-04-27 12:20 ` Oscar Salvador
2022-04-27 12:20 ` HORIGUCHI NAOYA(堀口 直也)
2022-04-28 8:44 ` David Hildenbrand
2022-05-09 7:29 ` HORIGUCHI NAOYA(堀口 直也)
2022-05-09 9:04 ` Miaohe Lin
2022-05-09 9:58 ` Oscar Salvador
2022-05-09 10:53 ` Miaohe Lin
2022-05-11 15:11 ` David Hildenbrand
2022-05-11 16:10 ` HORIGUCHI NAOYA(堀口 直也)
2022-05-11 16:22 ` David Hildenbrand
2022-05-12 3:04 ` Miaohe Lin
2022-05-12 6:35 ` HORIGUCHI NAOYA(堀口 直也)
2022-05-12 7:28 ` David Hildenbrand
2022-05-12 11:13 ` Miaohe Lin
2022-05-12 12:59 ` David Hildenbrand
2022-05-16 3:25 ` Miaohe Lin
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=828cc111-40e8-88ed-bb50-fb185e5f0304@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@linux.dev \
--cc=naoya.horiguchi@nec.com \
--cc=osalvador@suse.de \
--cc=shy828301@gmail.com \
--cc=songmuchun@bytedance.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