[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230720235507.GA2069669@ik1-406-35019.vs.sakura.ne.jp>
Date: Fri, 21 Jul 2023 08:55:07 +0900
From: Naoya Horiguchi <naoya.horiguchi@...ux.dev>
To: Miaohe Lin <linmiaohe@...wei.com>
Cc: akpm@...ux-foundation.org, naoya.horiguchi@....com,
shy828301@...il.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] mm: memory-failure: add PageOffline() check
On Thu, Jul 20, 2023 at 04:42:04PM +0800, Miaohe Lin wrote:
> On 2023/7/20 9:09, Naoya Horiguchi wrote:
> > On Sat, Jul 15, 2023 at 11:17:29AM +0800, Miaohe Lin wrote:
> >> Memory failure is not interested in logically offlined page. Skip this
> >> type of pages.
> >>
> >> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> >> ---
> >> mm/memory-failure.c | 5 +++--
> >> 1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> >> index 42e63b0ab5f7..ed79b69837de 100644
> >> --- a/mm/memory-failure.c
> >> +++ b/mm/memory-failure.c
> >> @@ -1559,7 +1559,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,
> >> * Here we are interested only in user-mapped pages, so skip any
> >> * other types of pages.
> >> */
> >> - if (PageReserved(p) || PageSlab(p) || PageTable(p))
> >> + if (PageReserved(p) || PageSlab(p) || PageTable(p) || PageOffline(p))
> >
> > hwpoison_user_mappings() is called after some checks are done, so I'm not
> > sure that it's the right place to check PageOffline().
>
> hwpoison_user_mappings() is called after the "if (!PageLRU(p) && !PageWriteback(p))" check in memory_failure().
> So the page can't also be PageReserved(p) or PageSlab(p) or PageTable(p) here? I think the check here just wants
> to make things clear that only user-mapped pages are interested. Or am I miss something?
No, you're right,
So this "if (PageReserved(p) || PageSlab(p) || PageTable(p) || PageOffline(p))"
can be considered as checking potential deviation.
OK, so the patch is fine.
Acked-by: Naoya Horiguchi <naoya.horiguchi@....com>
Powered by blists - more mailing lists