mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: "David Hildenbrand (Arm)" <david@kernel.org>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	linux-mm@kvack.org, Lorenzo Stoakes <ljs@kernel.org>,
	Lance Yang <lance.yang@linux.dev>,
	Kiryl Shutsemau <kas@kernel.org>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/uverbs: Don't return the shared zero page from rdma_umap_fault()
Date: Tue, 3 Nov 2026 14:25:42 +0200	[thread overview]
Message-ID: <20261103122542.GH264423@unreal> (raw)
In-Reply-To: <5E86E76B-F97A-4998-9EDB-8E450470FA4A@nvidia.com>

On Wed, Oct 28, 2026 at 01:49:23PM -0400, Zi Yan wrote:
> On 28 Oct 2026, at 4:43, David Hildenbrand (Arm) wrote:
> 
> >>>> +	/*
> >>>> +	 * VMAs that cannot become writable map the page as a raw pfn, like
> >>>> +	 * the device memory it replaces. The page lives as long as the file.
> >>>> +	 */
> >>>> +	if (!(vmf->vma->vm_flags & (VM_WRITE | VM_MAYWRITE))) {
> >>>> +		ret = vmf_insert_pfn(vmf->vma, vmf->address, page_to_pfn(page));
> >>>> +		goto out;
> >>>> +	}
> >>>> +
> >>>> +	/*
> >>>> +	 * This VMA is forced to always be shared so this doesn't have
> >>>> +	 * to worry about COW.
> >>>> +	 */
> >>>> +	vmf->page = page;
> >>>> +	get_page(page);
> >>>
> >>>
> >>> This split handling is pretty horrible TBH.
> >>>
> >>> In once case we take a reference in the other not?
> >>>
> >>> Why not perform a PFN mapping in any case?
> >>
> >> For writable path, a new vmf_insert_pfn_mkwrite() is needed, so it was
> >> not fixed. I can fix that part as well.
> >
> > We should do that; returning kernel allocations from this function in ->fault is
> > bad.
> >
> > How urgent is this fix here? (can it actually be triggered?Specific hardware?)
> >
> 
> Not urgent. Like Jason said in another email, RDMA only runs on arch
> with special PTE, so refcount, mapcount, rss are balanced. With DEBUG_VM,
> zero_page checks in rmap will fire on the returned zero_page.
> 
> >>
> >> The read-only zero page part might need more attention, since
> >> we just prevented vmf_insert_pfn_prot() from using zero_page. Do we want
> >> to add the support for rdma_umap_fault()?
> >
> > We just have to make sure that we cannot install it writable etc. But that's not
> > a concern.
> >
> > Just have to be careful :)
> 
> There is one wrinkle, it does not work on
> s390 + mm_forbids_zeropage() == true, where zero page is not present,
> and a private zero page is needed.
> 
> Jason, is RDMA supported on s390? 

Yes

      parent reply	other threads:[~2026-11-03 13:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26  2:04 Zi Yan
2026-10-26  8:55 ` Jose A. Perez de Azpillaga
2026-10-26 11:49 ` Jason Gunthorpe
2026-10-26 15:41   ` Zi Yan
2026-10-26 12:20 ` David Hildenbrand (Arm)
2026-10-26 15:48   ` Zi Yan
2026-10-28  8:43     ` David Hildenbrand (Arm)
2026-10-28 17:49       ` Zi Yan
2026-10-28 20:34         ` David Hildenbrand (Arm)
2026-10-29  2:00           ` Zi Yan
2026-10-29 10:44             ` David Hildenbrand (Arm)
2026-11-03 12:25         ` Leon Romanovsky [this message]

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=20261103122542.GH264423@unreal \
    --to=leon@kernel.org \
    --cc=david@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=kas@kernel.org \
    --cc=lance.yang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=ljs@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®