All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jason Gunthorpe <jgg@ziepe.ca>, Peter Xu <peterx@redhat.com>,
	Mike Rapoport <rppt@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, Sourab Gupta <sougupta@nvidia.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: Re: [PATCH] mm/gup: fix GUP-fast fallback for NULL-mapping order-0 folios
Date: Thu, 9 Apr 2026 19:31:44 +0200	[thread overview]
Message-ID: <794e7270-c91d-42eb-b2a6-67929198a1da@kernel.org> (raw)
In-Reply-To: <1A7433E5-C8C1-45EC-A0B7-2BDC7D065B1A@nvidia.com>

On 4/9/26 18:55, Zi Yan wrote:
> On 9 Apr 2026, at 11:11, David Hildenbrand (Arm) wrote:
> 
>> On 4/9/26 17:05, Zi Yan wrote:
>>>
>>>
>>> The idea is to give every allocated page a NotRmappable page_type and
>>> 1) let page_rmappable_folio() remove the page_type by setting mapcount
>>> to 0, since page_type overlaps with mapcount;
>>> 2) allow callers of alloc_page*() to change page_type from NotRmappable
>>> to other types.
>>
>> Could we instead just set the special type in vm_insert_page(), after
>> verifying that it does not have any other type?
> 
> You mean in validate_page_before_insert() we set the page to NotRmappable
> if it can be inserted, then in the rmap code we reject NotRmappable
> page/folios? And NotRmappable will remain until the page/folio is freed.
> That should work. So the purpose is to avoid setting the page_type if
> a page/folio is never going through vm_insert_page()?

Yes, only these non-folio pages will show up process page tables.

We would add a safety check that the mapcount really is 0 (-1) or
already the proper type (NotRmappable).

Rmap code would then simply skip any such thing.

-- 
Cheers,

David


  reply	other threads:[~2026-04-09 17:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09  1:46 [PATCH] mm/gup: fix GUP-fast fallback for NULL-mapping order-0 folios John Hubbard
2026-04-09  2:07 ` Andrew Morton
2026-04-09  2:09   ` John Hubbard
2026-04-09  7:52 ` David Hildenbrand (Arm)
2026-04-09 15:05   ` Zi Yan
2026-04-09 15:11     ` David Hildenbrand (Arm)
2026-04-09 16:55       ` Zi Yan
2026-04-09 17:31         ` David Hildenbrand (Arm) [this message]
2026-04-09 17:33           ` Zi Yan
2026-05-15  0:09   ` Balbir Singh

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=794e7270-c91d-42eb-b2a6-67929198a1da@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=rppt@kernel.org \
    --cc=sougupta@nvidia.com \
    --cc=willy@infradead.org \
    --cc=ziy@nvidia.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 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.