Thread (22 messages) 22 messages, 5 authors, 2021-07-29

Re: [PATCH v1 2/6] mm/hwpoison: remove race consideration

From: Ding Hui <hidden>
Date: 2021-06-15 12:57:16
Also in: lkml

On 2021/6/14 10:12, Naoya Horiguchi wrote:
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help