linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Rik van Riel <riel@surriel.com>
Cc: <linux-mm@kvack.org>, <kernel-team@fb.com>,
	Oscar Salvador <osalvador@suse.de>,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	Mel Gorman <mgorman@suse.de>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	<stable@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm,hwpoison: unmap poisoned page before invalidation
Date: Mon, 28 Mar 2022 10:41:49 +0800	[thread overview]
Message-ID: <acc49e6b-acb4-2001-3bdd-241160811020@huawei.com> (raw)
In-Reply-To: <1d4dc5f732e8da263c2a2e783e4550419cfb0c7b.camel@surriel.com>

On 2022/3/28 10:24, Rik van Riel wrote:
> On Mon, 2022-03-28 at 10:14 +0800, Miaohe Lin wrote:
>> On 2022/3/27 4:14, Rik van Riel wrote:
>>
>>
>>>
>>>>>                         /* Retry if a clean page was removed
>>>>> from
>>>>> the cache. */
>>>>> -                       if (invalidate_inode_page(vmf->page))
>>>>> -                               poisonret = 0;
>>>>> -                       unlock_page(vmf->page);
>>>>> +                       if (invalidate_inode_page(page))
>>>>> +                               poisonret = VM_FAULT_NOPAGE;
>>>>> +                       unlock_page(page);
>>>
>>
>> Sure, but when I think more about this, it seems this fix isn't
>> ideal:
>> If VM_FAULT_NOPAGE is returned with page table unset, the process
>> will
>> re-trigger page fault again and again until invalidate_inode_page
>> succeeds
>> to evict the inode page. This might hang the process a really long
>> time.
>> Or am I miss something?
>>
> If invalidate_inode_page fails, we will return
> VM_FAULT_HWPOISON, and kill the task, instead
> of looping indefinitely.

Oh, really sorry! It's a drowsy Monday morning. :)

This patch looks good to me. Thanks!

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

> 



  reply	other threads:[~2022-03-28  2:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 20:14 [PATCH] mm,hwpoison: unmap poisoned page before invalidation Rik van Riel
2022-03-26  7:48 ` Miaohe Lin
2022-03-26 20:14   ` Rik van Riel
2022-03-28  2:14     ` Miaohe Lin
2022-03-28  2:24       ` Rik van Riel
2022-03-28  2:41         ` Miaohe Lin [this message]
2022-03-28  9:00 ` Oscar Salvador
2022-03-29 15:49   ` Rik van Riel
2022-03-29 19:13     ` Oscar Salvador
2022-03-28 11:01 ` HORIGUCHI NAOYA(堀口 直也)
2022-03-29 19:13 ` Oscar Salvador

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acc49e6b-acb4-2001-3bdd-241160811020@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=naoya.horiguchi@nec.com \
    --cc=osalvador@suse.de \
    --cc=riel@surriel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).