linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Yang Shi <shy828301@gmail.com>, David Hildenbrand <david@redhat.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	"HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>,
	"Mike Kravetz" <mike.kravetz@oracle.com>,
	"Linux MM" <linux-mm@kvack.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] mm/memory-failure.c: avoid false-postive PageSwapCache test
Date: Sat, 9 Apr 2022 10:36:19 +0800	[thread overview]
Message-ID: <80b5b191-222b-493c-0192-80ceb5afafa8@huawei.com> (raw)
In-Reply-To: <CAHbLzko-oobg2rNO0y-Sgj9ePPEpoFEMmhgBumjzzFFFa=argw@mail.gmail.com>

On 2022/4/9 1:32, Yang Shi wrote:
> On Fri, Apr 8, 2022 at 1:52 AM David Hildenbrand <david@redhat.com> wrote:
>>
>> On 07.04.22 15:03, Miaohe Lin wrote:
>>> PageSwapCache is only reliable when PageAnon is true because PG_swapcache
>>> serves as PG_owner_priv_1 which can be used by fs if it's pagecache page.
>>> So we should test PageAnon to distinguish pagecache page from swapcache
>>> page to avoid false-postive PageSwapCache test.
>>
>> Well, that's not quite correct. Just because a page is PageAnon()
>> doesn't mean that it's in the swapache. It means that it might be in the
>> swapcache but cannot be in the pagecache.
>>
>> Maybe you wanted to say
>>
>> "So we should test PageAnon() to distinguish pagecache pages from
>> anonymous pages."

That's indeed what I want to say.

> 
> Yeah, I agree. The patch looks fine to me with David's comment addressed.

Many thanks for both of you! Will do it in v3.

> 
>>
>>>
>>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>>> ---
>>>  mm/memory-failure.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
>>> index ef402b490663..2e97302d62e4 100644
>>> --- a/mm/memory-failure.c
>>> +++ b/mm/memory-failure.c
>>> @@ -2262,7 +2262,7 @@ static int __soft_offline_page(struct page *page)
>>>               return 0;
>>>       }
>>>
>>> -     if (!PageHuge(page) && PageLRU(page) && !PageSwapCache(page))
>>> +     if (!PageHuge(page) && PageLRU(page) && !PageAnon(page))
>>>               /*
>>>                * Try to invalidate first. This should work for
>>>                * non dirty unmapped page cache pages.
>>
>>
>> --
>> Thanks,
>>
>> David / dhildenb
>>
>>
> .
> 



  reply	other threads:[~2022-04-09  2:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 13:03 [PATCH 0/3] A few fixup and cleanup patches for memory failure Miaohe Lin
2022-04-07 13:03 ` [PATCH 1/3] mm/memory-failure.c: avoid false-postive PageSwapCache test Miaohe Lin
2022-04-08  8:52   ` David Hildenbrand
2022-04-08 17:32     ` Yang Shi
2022-04-09  2:36       ` Miaohe Lin [this message]
2022-04-11  6:35   ` HORIGUCHI NAOYA(堀口 直也)
2022-04-11 13:19     ` Miaohe Lin
2022-04-12  6:37       ` HORIGUCHI NAOYA(堀口 直也)
2022-04-12  8:57         ` Miaohe Lin
2022-04-07 13:03 ` [PATCH 2/3] mm/memory-failure.c: minor cleanup for HWPoisonHandlable Miaohe Lin
2022-04-08  8:52   ` David Hildenbrand
2022-04-08 17:33   ` Yang Shi
2022-04-11 13:14   ` HORIGUCHI NAOYA(堀口 直也)
2022-04-07 13:03 ` [PATCH 3/3] mm/memory-failure.c: dissolve truncated hugetlb page Miaohe Lin
2022-04-11 13:13   ` HORIGUCHI NAOYA(堀口 直也)
2022-04-12  2:47     ` Miaohe Lin
2022-04-12  5:59       ` HORIGUCHI NAOYA(堀口 直也)
2022-04-12  6:10         ` Miaohe Lin

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=80b5b191-222b-493c-0192-80ceb5afafa8@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=naoya.horiguchi@nec.com \
    --cc=shy828301@gmail.com \
    /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