All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pantelis Antoniou <p.antoniou@partner.samsung.com>
To: David Hildenbrand <david@redhat.com>
Cc: Peter Xu <peterx@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	<mm-commits@vger.kernel.org>, <wade.farnsworth@siemens.com>,
	<jhubbard@nvidia.com>, <jgg@ziepe.ca>, <c.briere@samsung.com>,
	<artem.k@samsung.com>, David Howells <dhowells@redhat.com>
Subject: Re: + fix-zero-copy-i-o-on-__get_user_pages-allocated-pages.patch added to mm-hotfixes-unstable branch
Date: Thu, 8 May 2025 18:27:18 +0300	[thread overview]
Message-ID: <20250508182718.40f16121@sarc.samsung.com> (raw)
In-Reply-To: <cc6d5e06-d0e5-44d7-9a1e-151fc39c5e7c@redhat.com>

On Thu, 8 May 2025 17:10:10 +0200
David Hildenbrand <david@redhat.com> wrote:

> On 08. 05. 25 17: 08, Peter Xu wrote: > On Thu, May 08, 2025 at 05:
> 36: 12PM +0300, Pantelis Antoniou wrote: >> On Thu, 8 May 2025 10:
> 16: 31 -0400 >> Peter Xu <peterx@ redhat. com> wrote: >> >> Hi Peter,

> On 08.05.25 17:08, Peter Xu wrote:
> > On Thu, May 08, 2025 at 05:36:12PM +0300, Pantelis Antoniou wrote:
> >> On Thu, 8 May 2025 10:16:31 -0400
> >> Peter Xu <peterx@redhat.com> wrote:
> >>
> >> Hi Peter,
> > 
> > Hi, Pantelis,
> > 
> > [...]
> > 
> >>>> @@ -1271,8 +1287,6 @@ static int check_vma_flags(struct vm_are
> >>>>   	int foreign = (gup_flags & FOLL_REMOTE);
> >>>>   	bool vma_anon = vma_is_anonymous(vma);
> >>>>   
> >>>> -	if (vm_flags & (VM_IO | VM_PFNMAP))
> >>>> -		return -EFAULT;
> >>>
> >>> Is there's any justification that this won't break some existing
> >>> GUP users that may rely on properly failing at pfnmaps?
> >>>
> >>> IIUC netfs isn't the first one that wants to GUP on top of
> >>> pfnmaps, KVM does it for years and so far it was processed in a
> >>> standalone path:
> >>>
> >>> hva_to_pfn:
> >>> 	else if (vma->vm_flags & (VM_IO | VM_PFNMAP)) {
> >>> 		r = hva_to_pfn_remapped(vma, kfp, &pfn);
> >>>
> >>> That started with supporting real pfnmaps (with no page struct),
> >>> but pfnmap with page structs can also happen afaict, and kvm
> >>> processes that too by checking page==NULL ultimately, e.g. in
> >>> kvm_release_faultin_page().
> >>>
> >>
> >> I see. The problem is that we're not the owners of the code in
> >> netfslib, and it is considerably more intrusive to fix things
> >> there.
> >>
> >> This is a hotfix for a userspace regression. I sort of agree that
> >> having different handling for these areas in netfslib would be
> >> ideal.
> > 
> > Do you mean this used to work in older kernels?  Some more info on
> > the regression would be more than welcomed if so..  If it fixes a
> > kernel regression, we may want a Fixes for whatever patch at last.
> 
> To be precise: Whoever decided to use remap_pfn_range() essentially 
> decided that GUP cannot possibly work.
> 
> So is the regression introduced by a conversion to remap_pfn_range()
> in some code, or because suddenly someone relies on GUP for these
> things?
> 

I don't think there was a deliberate decision here, but there was no
conversion to remap_pfn_range(), the code (in DRM) was always there.

The regression occurred when netfslib started using GUP for I/O and
when filesystems switched to it we hit this case.

Regards

-- Pantelis

  reply	other threads:[~2025-05-08 15:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 21:55 + fix-zero-copy-i-o-on-__get_user_pages-allocated-pages.patch added to mm-hotfixes-unstable branch Andrew Morton
2025-05-08 14:16 ` Peter Xu
2025-05-08 14:36   ` Pantelis Antoniou
2025-05-08 15:08     ` Peter Xu
2025-05-08 15:10       ` David Hildenbrand
2025-05-08 15:27         ` Pantelis Antoniou [this message]
2025-05-08 15:40           ` David Hildenbrand
2025-05-08 15:48             ` Pantelis Antoniou
2025-05-08 16:25             ` Pantelis Antoniou
2025-05-08 17:35             ` Jason Gunthorpe
2025-05-08 17:47               ` Pantelis Antoniou
2025-05-08 18:01                 ` Jason Gunthorpe
2025-05-08 18:02                 ` David Hildenbrand
2025-05-08 18:11                   ` Pantelis Antoniou
2025-05-08 18:26                     ` David Hildenbrand
2025-05-08 18:47                     ` Peter Xu
2025-05-08 19:04                       ` David Hildenbrand
2025-05-08 19:06                         ` Jason Gunthorpe
2025-05-08 19:08                         ` Peter Xu
2025-05-08 19:12                           ` Jason Gunthorpe
2025-05-08 19:16                             ` David Hildenbrand
2025-05-08 19:39                             ` Peter Xu
2025-05-08 19:14                           ` David Hildenbrand
2025-05-08 19:19                             ` Jason Gunthorpe
2025-05-08 19:34                               ` David Hildenbrand
2025-05-09 16:30                                 ` Pantelis Antoniou
2025-05-09 17:11                                   ` John Hubbard
2025-05-09 17:33                                     ` Jason Gunthorpe
2025-05-09 17:50                                       ` Pantelis Antoniou
2025-05-09 18:39                                         ` Jason Gunthorpe
2025-05-08 19:11                     ` Jason Gunthorpe
2025-05-08 15:17       ` Pantelis Antoniou

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=20250508182718.40f16121@sarc.samsung.com \
    --to=p.antoniou@partner.samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=artem.k@samsung.com \
    --cc=c.briere@samsung.com \
    --cc=david@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=wade.farnsworth@siemens.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.