From: David Hildenbrand <david@redhat.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH 4/9] mm: Remove some calls to page_add_new_anon_rmap()
Date: Tue, 12 Dec 2023 14:20:15 +0100 [thread overview]
Message-ID: <0481e512-8a1a-4b47-a4d9-94a06745b683@redhat.com> (raw)
In-Reply-To: <20231211162214.2146080-5-willy@infradead.org>
On 11.12.23 17:22, Matthew Wilcox (Oracle) wrote:
> We already have the folio in these functions, we just need to use it.
> folio_add_new_anon_rmap() didn't exist at the time they were converted
> to folios.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> kernel/events/uprobes.c | 2 +-
> mm/memory.c | 2 +-
> mm/userfaultfd.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index 435aac1d8c27..8b115fc43f04 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -181,7 +181,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
>
> if (new_page) {
> folio_get(new_folio);
> - page_add_new_anon_rmap(new_page, vma, addr);
> + folio_add_new_anon_rmap(new_folio, vma, addr);
> folio_add_lru_vma(new_folio, vma);
> } else
> /* no new page, just dec_mm_counter for old_page */
> diff --git a/mm/memory.c b/mm/memory.c
> index 318f923134e4..c03a7729d5b4 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -4068,7 +4068,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
>
> /* ksm created a completely new copy */
> if (unlikely(folio != swapcache && swapcache)) {
> - page_add_new_anon_rmap(page, vma, vmf->address);
> + folio_add_new_anon_rmap(folio, vma, vmf->address);
> folio_add_lru_vma(folio, vma);
> } else {
> page_add_anon_rmap(page, vma, vmf->address, rmap_flags);
> diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
> index 71d0281f1162..2d8b03a009b4 100644
> --- a/mm/userfaultfd.c
> +++ b/mm/userfaultfd.c
> @@ -116,7 +116,7 @@ int mfill_atomic_install_pte(pmd_t *dst_pmd,
> folio_add_lru(folio);
> page_add_file_rmap(page, dst_vma, false);
> } else {
> - page_add_new_anon_rmap(page, dst_vma, dst_addr);
> + folio_add_new_anon_rmap(folio, dst_vma, dst_addr);
> folio_add_lru_vma(folio, dst_vma);
> }
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2023-12-12 13:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 16:22 [PATCH 0/9] Finish two folio conversions Matthew Wilcox (Oracle)
2023-12-11 16:22 ` [PATCH 1/9] mm: Convert ksm_might_need_to_copy() to work on folios Matthew Wilcox (Oracle)
2023-12-12 12:32 ` David Hildenbrand
2023-12-12 12:43 ` Matthew Wilcox
2023-12-12 12:43 ` David Hildenbrand
2023-12-11 16:22 ` [PATCH 2/9] mm: Simplify the assertions in unuse_pte() Matthew Wilcox (Oracle)
2023-12-12 12:26 ` David Hildenbrand
2023-12-12 13:52 ` Matthew Wilcox
2023-12-12 13:55 ` David Hildenbrand
2023-12-11 16:22 ` [PATCH 3/9] mm: Convert unuse_pte() to use a folio throughout Matthew Wilcox (Oracle)
2023-12-11 16:22 ` [PATCH 4/9] mm: Remove some calls to page_add_new_anon_rmap() Matthew Wilcox (Oracle)
2023-12-12 13:20 ` David Hildenbrand [this message]
2023-12-11 16:22 ` [PATCH 5/9] mm: Remove stale example from comment Matthew Wilcox (Oracle)
2023-12-12 13:20 ` David Hildenbrand
2023-12-11 16:22 ` [PATCH 6/9] mm: Remove references to page_add_new_anon_rmap in comments Matthew Wilcox (Oracle)
2023-12-12 13:20 ` David Hildenbrand
2023-12-11 16:22 ` [PATCH 7/9] mm: Convert migrate_vma_insert_page() to use a folio Matthew Wilcox (Oracle)
2023-12-11 22:17 ` Alistair Popple
2023-12-12 13:21 ` David Hildenbrand
2023-12-11 16:22 ` [PATCH 8/9] mm: Convert collapse_huge_page() " Matthew Wilcox (Oracle)
2023-12-12 13:21 ` David Hildenbrand
2023-12-11 16:22 ` [PATCH 9/9] mm: Remove page_add_new_anon_rmap and lru_cache_add_inactive_or_unevictable Matthew Wilcox (Oracle)
2023-12-12 13:21 ` David Hildenbrand
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=0481e512-8a1a-4b47-a4d9-94a06745b683@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox