[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ee3ee18c-27a0-4c38-a639-e93e91a392ad@redhat.com>
Date: Tue, 2 Sep 2025 09:46:29 +0200
From: David Hildenbrand <david@...hat.com>
To: Alistair Popple <apopple@...dia.com>, linux-mm@...ck.org,
akpm@...ux-foundation.org
Cc: osalvador@...e.de, jgg@...pe.ca, jhubbard@...dia.com, peterx@...hat.com,
linux-kernel@...r.kernel.org, dan.j.williams@...el.com
Subject: Re: [PATCH 1/2] mm/gup: Remove dead pgmap refcounting code
On 02.09.25 07:14, Alistair Popple wrote:
> Prior to aed877c2b425 ("device/dax: properly refcount device dax pages
"to commit aed877c2b425" ...
> when mapping") ZONE_DEVICE pages were not fully reference counted when
> mapped into user page tables. Instead GUP would take a reference on the
> associated pgmap to ensure the results of pfn_to_page() remained valid.
>
> This is no longer required and most of the code was removed by
> fd2825b0760a ("mm/gup: remove pXX_devmap usage from get_user_pages()").
"by commit fd2825b0760a"
Otherwise checkpatch complains.
> Finish cleaning this up by removing the dead calls to put_dev_pagemap()
> and the temporary context struct.
[...]
> {
> @@ -661,7 +656,7 @@ static inline bool can_follow_write_pud(pud_t pud, struct page *page,
>
> static struct page *follow_huge_pud(struct vm_area_struct *vma,
> unsigned long addr, pud_t *pudp,
> - int flags, struct follow_page_context *ctx)
> + int flags, unsigned long *page_mask)
> {
> struct mm_struct *mm = vma->vm_mm;
> struct page *page;
> @@ -688,7 +683,7 @@ static struct page *follow_huge_pud(struct vm_area_struct *vma,
> if (ret)
> page = ERR_PTR(ret);
> else
> - ctx->page_mask = HPAGE_PUD_NR - 1;
> + *page_mask = HPAGE_PUD_NR - 1;
At some point we should remove that page_mask thingy as well and handle
it like gup-fast: let follow_* will in the array directly.
Lovely
Acked-by: David Hildenbrand <david@...hat.com>
--
Cheers
David / dhildenb
Powered by blists - more mailing lists