linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memory-failure: Fix return wrong value when isolate page fail
@ 2020-08-30  8:10 Muchun Song
       [not found] ` <20200830194417.GA4039@lca.pw>
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Muchun Song @ 2020-08-30  8:10 UTC (permalink / raw)
  To: naoya.horiguchi, akpm; +Cc: linux-mm, linux-kernel, Muchun Song

When we isolate page fail, we should not return 0, because we do not
set page HWPoison on any page.

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/memory-failure.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 696505f56910..4eb3c42ffe35 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1850,6 +1850,7 @@ static int __soft_offline_page(struct page *page)
 	} else {
 		pr_info("soft offline: %#lx: %s isolation failed: %d, page count %d, type %lx (%pGp)\n",
 			pfn, msg_page[huge], ret, page_count(page), page->flags, &page->flags);
+		ret = -EBUSY;
 	}
 	return ret;
 }
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/memory-failure: Fix return wrong value when isolate page fail
       [not found] ` <20200830194417.GA4039@lca.pw>
@ 2020-08-30 22:27   ` HORIGUCHI NAOYA(堀口 直也)
  0 siblings, 0 replies; 4+ messages in thread
From: HORIGUCHI NAOYA(堀口 直也) @ 2020-08-30 22:27 UTC (permalink / raw)
  To: Qian Cai, Muchun Song; +Cc: akpm, linux-mm, linux-kernel

On Sun, Aug 30, 2020 at 03:44:18PM -0400, Qian Cai wrote:
> On Sun, Aug 30, 2020 at 04:10:53PM +0800, Muchun Song wrote:
> > When we isolate page fail, we should not return 0, because we do not
> > set page HWPoison on any page.
> > 
> > Signed-off-by: Muchun Song <songmuchun@bytedance.com>
> 
> This seems solve the problem for me that madvise(MADV_SOFT_OFFLINE) will run
> into ENOMEM eventually:
> 
> https://lore.kernel.org/lkml/20200811220643.GB39857@lca.pw/
> 
> Reviewed-by: Qian Cai <cai@lca.pw>

Thank you very much, both of you!

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

> > ---
> >  mm/memory-failure.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> > index 696505f56910..4eb3c42ffe35 100644
> > --- a/mm/memory-failure.c
> > +++ b/mm/memory-failure.c
> > @@ -1850,6 +1850,7 @@ static int __soft_offline_page(struct page *page)
> >  	} else {
> >  		pr_info("soft offline: %#lx: %s isolation failed: %d, page count %d, type %lx (%pGp)\n",
> >  			pfn, msg_page[huge], ret, page_count(page), page->flags, &page->flags);
> > +		ret = -EBUSY;
> >  	}
> >  	return ret;
> >  }
> > -- 
> > 2.11.0
> > 
> > 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/memory-failure: Fix return wrong value when isolate page fail
  2020-08-30  8:10 [PATCH] mm/memory-failure: Fix return wrong value when isolate page fail Muchun Song
       [not found] ` <20200830194417.GA4039@lca.pw>
@ 2020-08-31  7:31 ` Oscar Salvador
  2020-08-31  9:45 ` Pankaj Gupta
  2 siblings, 0 replies; 4+ messages in thread
From: Oscar Salvador @ 2020-08-31  7:31 UTC (permalink / raw)
  To: Muchun Song; +Cc: naoya.horiguchi, akpm, linux-mm, linux-kernel

On Sun, Aug 30, 2020 at 04:10:53PM +0800, Muchun Song wrote:
> When we isolate page fail, we should not return 0, because we do not
> set page HWPoison on any page.
> 
> Signed-off-by: Muchun Song <songmuchun@bytedance.com>

Thanks for spotting this

Reviewed-by: Oscar Salvador <osalvador@suse.de>

> ---
>  mm/memory-failure.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 696505f56910..4eb3c42ffe35 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1850,6 +1850,7 @@ static int __soft_offline_page(struct page *page)
>  	} else {
>  		pr_info("soft offline: %#lx: %s isolation failed: %d, page count %d, type %lx (%pGp)\n",
>  			pfn, msg_page[huge], ret, page_count(page), page->flags, &page->flags);
> +		ret = -EBUSY;
>  	}
>  	return ret;
>  }
> -- 
> 2.11.0
> 
> 

-- 
Oscar Salvador
SUSE L3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/memory-failure: Fix return wrong value when isolate page fail
  2020-08-30  8:10 [PATCH] mm/memory-failure: Fix return wrong value when isolate page fail Muchun Song
       [not found] ` <20200830194417.GA4039@lca.pw>
  2020-08-31  7:31 ` Oscar Salvador
@ 2020-08-31  9:45 ` Pankaj Gupta
  2 siblings, 0 replies; 4+ messages in thread
From: Pankaj Gupta @ 2020-08-31  9:45 UTC (permalink / raw)
  To: Muchun Song; +Cc: naoya.horiguchi, Andrew Morton, Linux MM, LKML

> When we isolate page fail, we should not return 0, because we do not
> set page HWPoison on any page.
>
> Signed-off-by: Muchun Song <songmuchun@bytedance.com>
> ---
>  mm/memory-failure.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 696505f56910..4eb3c42ffe35 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1850,6 +1850,7 @@ static int __soft_offline_page(struct page *page)
>         } else {
>                 pr_info("soft offline: %#lx: %s isolation failed: %d, page count %d, type %lx (%pGp)\n",
>                         pfn, msg_page[huge], ret, page_count(page), page->flags, &page->flags);
> +               ret = -EBUSY;
>         }
>         return ret;
>  }
> --

Acked-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
> 2.11.0
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-31  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-30  8:10 [PATCH] mm/memory-failure: Fix return wrong value when isolate page fail Muchun Song
     [not found] ` <20200830194417.GA4039@lca.pw>
2020-08-30 22:27   ` HORIGUCHI NAOYA(堀口 直也)
2020-08-31  7:31 ` Oscar Salvador
2020-08-31  9:45 ` Pankaj Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).