[v2,1/8] mm: memory-failure: remove unneeded PageHuge() check

Message ID 20230711055016.2286677-2-linmiaohe@huawei.com
State New
Headers
Series A few fixup and cleanup patches for memory-failure |

Commit Message

Miaohe Lin July 11, 2023, 5:50 a.m. UTC
  PageHuge() check in me_huge_page() is just for potential problems. Remove
it as it's actually dead code and won't catch anything.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memory-failure.c | 3 ---
 1 file changed, 3 deletions(-)
  

Comments

Naoya Horiguchi July 11, 2023, 9 a.m. UTC | #1
On Tue, Jul 11, 2023 at 01:50:09PM +0800, Miaohe Lin wrote:
> PageHuge() check in me_huge_page() is just for potential problems. Remove
> it as it's actually dead code and won't catch anything.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Thank you for updating.

Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>

> ---
>  mm/memory-failure.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 64d7d34c177a..913fcf02ad38 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1187,9 +1187,6 @@ static int me_huge_page(struct page_state *ps, struct page *p)
>  	struct address_space *mapping;
>  	bool extra_pins = false;
>  
> -	if (!PageHuge(hpage))
> -		return MF_DELAYED;
> -
>  	mapping = page_mapping(hpage);
>  	if (mapping) {
>  		res = truncate_error_page(hpage, page_to_pfn(p), mapping);
> -- 
> 2.33.0
> 
> 
>
  

Patch

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 64d7d34c177a..913fcf02ad38 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1187,9 +1187,6 @@  static int me_huge_page(struct page_state *ps, struct page *p)
 	struct address_space *mapping;
 	bool extra_pins = false;
 
-	if (!PageHuge(hpage))
-		return MF_DELAYED;
-
 	mapping = page_mapping(hpage);
 	if (mapping) {
 		res = truncate_error_page(hpage, page_to_pfn(p), mapping);