Skip to contentSkip to conversation

mm, hwpoison: remove obsolete comment

PATCH Applied Naoya Horiguchi 5 participants 5 messages Jan 25, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm, hwpoison: remove obsolete comment

From: Naoya Horiguchi <[email protected]>

With the introduction of mf_mutex, most of memory error handling process is mutually exclusive, so the in-line comment about subtlety about double-checking PageHWPoison is no more correct. So remove it.

---
 mm/memory-failure.c | 6 ------
 1 file changed, 6 deletions(-)
mm/memory-failure.c +0 -6
index 4c9bd1d37301..a6a1e02759e7 100644
@@ -2146,12 +2146,6 @@ static int __soft_offline_page(struct page *page)
 		.gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
 	};
 
-	/*
-	 * Check PageHWPoison again inside page lock because PageHWPoison
-	 * is set by memory_failure() outside page lock. Note that
-	 * memory_failure() also double-checks PageHWPoison inside page lock,
-	 * so there's no race between soft_offline_page() and memory_failure().
-	 */
 	lock_page(page);
 	if (!PageHuge(page))
 		wait_on_page_writeback(page);
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi:

Quoted 21 lines · Naoya Horiguchi

From: Naoya Horiguchi <[email protected]>

With the introduction of mf_mutex, most of memory error handling process is mutually exclusive, so the in-line comment about subtlety about double-checking PageHWPoison is no more correct. So remove it.

---
 mm/memory-failure.c | 6 ------
 1 file changed, 6 deletions(-)
mm/memory-failure.c +0 -0
index 4c9bd1d37301..a6a1e02759e7 100644
@@ -2146,12 +2146,6 @@ static int __soft_offline_page(struct page *page)
 		.gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
 	};

mm/memory-failure.c static int __soft_offline_page(struct page *page) · line 2151

Quoted 10 lines
mm/memory-failure.c +0 -6
 
-	/*
-	 * Check PageHWPoison again inside page lock because PageHWPoison
-	 * is set by memory_failure() outside page lock. Note that
-	 * memory_failure() also double-checks PageHWPoison inside page lock,
-	 * so there's no race between soft_offline_page() and memory_failure().
-	 */
 	lock_page(page);
 	if (!PageHuge(page))
 		wait_on_page_writeback(page);

Looks good to me. Thanks for the patch.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Naoya Horiguchi
Quoted 21 lines · Naoya Horiguchi

From: Naoya Horiguchi <[email protected]>

With the introduction of mf_mutex, most of memory error handling process is mutually exclusive, so the in-line comment about subtlety about double-checking PageHWPoison is no more correct. So remove it.

---
 mm/memory-failure.c | 6 ------
 1 file changed, 6 deletions(-)
mm/memory-failure.c +0 -0
index 4c9bd1d37301..a6a1e02759e7 100644
@@ -2146,12 +2146,6 @@ static int __soft_offline_page(struct page *page)
 		.gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
 	};

mm/memory-failure.c static int __soft_offline_page(struct page *page) · line 2151

Quoted 10 lines
mm/memory-failure.c +0 -6
 
-	/*
-	 * Check PageHWPoison again inside page lock because PageHWPoison
-	 * is set by memory_failure() outside page lock. Note that
-	 * memory_failure() also double-checks PageHWPoison inside page lock,
-	 * so there's no race between soft_offline_page() and memory_failure().
-	 */
 	lock_page(page);
 	if (!PageHuge(page))
 		wait_on_page_writeback(page);
Reviewed-by on v1 1/1
#3 lore raw
In reply to Naoya Horiguchi
Quoted 9 lines · Naoya Horiguchi

From: Naoya Horiguchi <[email protected]>

With the introduction of mf_mutex, most of memory error handling process is mutually exclusive, so the in-line comment about subtlety about double-checking PageHWPoison is no more correct. So remove it.

Signature · 2 lines
Oscar Salvador
SUSE Labs
Reviewed-by on v1 1/1
#4 lore raw
In reply to Naoya Horiguchi
Quoted 10 lines · Naoya Horiguchi

From: Naoya Horiguchi <[email protected]>

With the introduction of mf_mutex, most of memory error handling process is mutually exclusive, so the in-line comment about subtlety about double-checking PageHWPoison is no more correct. So remove it.

Quoted 25 lines
---
 mm/memory-failure.c | 6 ------
 1 file changed, 6 deletions(-)
mm/memory-failure.c +0 -7
index 4c9bd1d37301..a6a1e02759e7 100644
@@ -2146,12 +2146,6 @@ static int __soft_offline_page(struct page *page)
                .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
        };
 
-       /*
-        * Check PageHWPoison again inside page lock because PageHWPoison
-        * is set by memory_failure() outside page lock. Note that
-        * memory_failure() also double-checks PageHWPoison inside page lock,
-        * so there's no race between soft_offline_page() and memory_failure().
-        */
        lock_page(page);
        if (!PageHuge(page))
                wait_on_page_writeback(page);
--

2.25.1