[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <25c69dc8-0ce2-8330-dfb0-506481dc9a53@sangfor.com.cn>
Date: Tue, 15 Jun 2021 20:57:06 +0800
From: Ding Hui <dinghui@...gfor.com.cn>
To: Naoya Horiguchi <nao.horiguchi@...il.com>, linux-mm@...ck.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Oscar Salvador <osalvador@...e.de>,
Michal Hocko <mhocko@...e.com>,
Tony Luck <tony.luck@...el.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
Naoya Horiguchi <naoya.horiguchi@....com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/6] mm/hwpoison: remove race consideration
On 2021/6/14 10:12, Naoya Horiguchi wrote:
> @@ -1956,17 +1938,6 @@ int unpoison_memory(unsigned long pfn)
> goto unlock_mutex;
> }
>
> - /*
> - * unpoison_memory() can encounter thp only when the thp is being
> - * worked by memory_failure() and the page lock is not held yet.
> - * In such case, we yield to memory_failure() and make unpoison fail.
> - */
> - if (!PageHuge(page) && PageTransHuge(page)) {
> - unpoison_pr_info("Unpoison: Memory failure is now running on %#lx\n",
> - pfn, &unpoison_rs);
> - goto unlock_mutex;
> - }
> -
if a huge page is in process of alloc or free, HUGETLB_PAGE_DTOR can be
set after __SetPageHead() or be cleared before __ClearPageHead(), so
this condition may be true in racy.
Do we need the racy test for this situation?
> if (!get_hwpoison_page(p, flags)) {
> if (TestClearPageHWPoison(p))
> num_poisoned_pages_dec();
--
Thanks,
- Ding Hui
Powered by blists - more mailing lists