linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Alistair Popple <apopple@nvidia.com>,
	linux-mm@kvack.org, akpm@linux-foundation.org
Cc: osalvador@suse.de, jgg@ziepe.ca, jhubbard@nvidia.com,
	peterx@redhat.com, linux-kernel@vger.kernel.org,
	dan.j.williams@intel.com
Subject: Re: [PATCH 1/2] mm/gup: Remove dead pgmap refcounting code
Date: Tue, 2 Sep 2025 09:46:29 +0200	[thread overview]
Message-ID: <ee3ee18c-27a0-4c38-a639-e93e91a392ad@redhat.com> (raw)
In-Reply-To: <20250902051421.162498-1-apopple@nvidia.com>

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@redhat.com>

-- 
Cheers

David / dhildenb


  parent reply	other threads:[~2025-09-02  7:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02  5:14 [PATCH 1/2] mm/gup: Remove dead pgmap refcounting code Alistair Popple
2025-09-02  5:14 ` [PATCH 2/2] mm/memremap: Remove unused get_dev_pagemap() parameter Alistair Popple
2025-09-02  7:47   ` David Hildenbrand
2025-09-02 12:06   ` Jason Gunthorpe
2025-09-02 20:31   ` kernel test robot
2025-09-03  1:20   ` dan.j.williams
2025-09-02  7:46 ` David Hildenbrand [this message]
2025-09-02 22:52   ` [PATCH 1/2] mm/gup: Remove dead pgmap refcounting code Alistair Popple
2025-09-02 12:06 ` Jason Gunthorpe
2025-09-03 23:07   ` Alistair Popple
2025-09-03  1:17 ` dan.j.williams

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=ee3ee18c-27a0-4c38-a639-e93e91a392ad@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=dan.j.williams@intel.com \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=peterx@redhat.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;
as well as URLs for NNTP newsgroup(s).