All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
	David Hildenbrand <david@redhat.com>,
	<linux-s390@vger.kernel.org>
Subject: Re: [PATCH v2 06/10] mm: memory: use a folio in zap_pte_range()
Date: Mon, 6 Nov 2023 23:08:56 +0800	[thread overview]
Message-ID: <c4186f18-5a49-4fd6-ab19-6db77bcfc541@huawei.com> (raw)
In-Reply-To: <ZUj2SCML4h7X5TWu@casper.infradead.org>



On 2023/11/6 22:20, Matthew Wilcox wrote:
> On Mon, Nov 06, 2023 at 10:30:59AM +0800, Kefeng Wang wrote:
>> On 2023/11/5 1:20, Matthew Wilcox wrote:
>>>> -				page_remove_rmap(page, vma, false);
>>>> -			put_page(page);
>>>> +				page_remove_rmap(&folio->page, vma, false);
>>>> +			folio_put(folio);
>>>
>>> This is wrong.  If we have a PTE-mapped THP, you'll remove the head page
>>> N times instead of removing each of N pages.
>>
>> This is device private entry, I suppose that it won't be a THP and large
>> folio when check migrate_vma_check_page() and migrate_vma_insert_page(),
>> right?
> 
> I don't want to leave that kind of booby-trap in the code.  Both places
> which currently call page_remove_rmap() should be left as referring to
> the page, not the folio.

Sure, I will fix this, also page_try_dup_anon_rmap() for device private
entry in copy_nonpresent_pte of patch5.


  reply	other threads:[~2023-11-06 15:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-04  3:55 [PATCH rfc v2 00/10] mm: convert mm counter to take a folio Kefeng Wang
2023-11-04  3:55 ` [PATCH v2 01/10] mm: swap: introduce pfn_swap_entry_to_folio() Kefeng Wang
2023-11-04  3:55 ` [PATCH v2 02/10] s390: pgtable: use a folio in ptep_zap_swap_entry() Kefeng Wang
2023-11-04  3:55 ` [PATCH v2 03/10] mm: huge_memory: use a folio in __split_huge_pmd_locked() Kefeng Wang
2023-11-04  3:55 ` [PATCH v2 04/10] mm: huge_memory: use a folio in zap_huge_pmd() Kefeng Wang
2023-11-04  3:55 ` [PATCH v2 05/10] mm: memory: use a folio in copy_nonpresent_pte() Kefeng Wang
2023-11-04  3:55 ` [PATCH v2 06/10] mm: memory: use a folio in zap_pte_range() Kefeng Wang
2023-11-04 17:20   ` Matthew Wilcox
2023-11-06  2:30     ` Kefeng Wang
2023-11-06 14:20       ` Matthew Wilcox
2023-11-06 15:08         ` Kefeng Wang [this message]
2023-11-04  3:55 ` [PATCH v2 07/10] mm: memory: use a folio in do_set_pmd() Kefeng Wang
2023-11-04  3:55 ` [PATCH v2 08/10] mm: memory: use a folio in insert_page_into_pte_locked() Kefeng Wang
2023-11-04  3:55 ` [PATCH v2 09/10] mm: convert mm_counter() to take a folio Kefeng Wang
2023-11-04  3:55 ` [PATCH v2 10/10] mm: convert mm_counter_file() " Kefeng Wang

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=c4186f18-5a49-4fd6-ab19-6db77bcfc541@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.