From: Souptick Joarder <jrdr.linux@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Ralph Campbell" <rcampbell@nvidia.com>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Michal Hocko" <mhocko@suse.com>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
"Peter Zijlstra" <peterz@infradead.org>,
airlied@redhat.com, "Thomas Hellstrom" <thellstrom@vmware.com>,
Linux-MM <linux-mm@kvack.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memory.c: Convert to use vmf_error()
Date: Fri, 6 Sep 2019 17:54:21 +0530 [thread overview]
Message-ID: <CAFqt6zZ_M3_Jr_08SO+OnnurWNbLJJsNZvVDZOnjh88vzaiXGg@mail.gmail.com> (raw)
In-Reply-To: <20190905185910.GS29434@bombadil.infradead.org>
On Fri, Sep 6, 2019 at 12:29 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Fri, Sep 06, 2019 at 12:13:00AM +0530, Souptick Joarder wrote:
> > +++ b/mm/memory.c
> > @@ -1750,13 +1750,10 @@ static vm_fault_t __vm_insert_mixed(struct vm_area_struct *vma,
> > } else {
> > return insert_pfn(vma, addr, pfn, pgprot, mkwrite);
> > }
> > -
> > - if (err == -ENOMEM)
> > - return VM_FAULT_OOM;
> > - if (err < 0 && err != -EBUSY)
> > - return VM_FAULT_SIGBUS;
> > -
> > - return VM_FAULT_NOPAGE;
> > + if (!err || err == -EBUSY)
> > + return VM_FAULT_NOPAGE;
> > + else
> > + return vmf_error(err);
> > }
>
> My plan is to convert insert_page() to return a VM_FAULT error code like
> insert_pfn() does. Need to finish off the vm_insert_page() conversions
> first ;-)
Previously we have problem while converting vm_insert_page() to return
vm_fault_t.
vm_insert_page() is called from different drivers. Some of them are
already converted
to use vm_map_pages()/ vm_map_pages_zero(). But still we left with few users.
drivers/media/usb/usbvision/usbvision-video.c#L1045
mm/vmalloc.c#L2969
These 2 can be converted with something like vm_map_vmalloc_pages().
I am working on it. Will post it in sometime.
drivers/android/binder_alloc.c#L259 (have objection)
drivers/infiniband/hw/efa/efa_verbs.c#L1701
drivers/infiniband/hw/mlx5/main.c#L2085 (have objection as using
vm_map_pages_zero() doesn't make sense)
drivers/xen/gntalloc.c#L548 (have limitation)
kernel/kcov.c#L297 (have objection)
net/ipv4/tcp.c#L1799
net/packet/af_packet.c#L4453
But these are the places where replacing vm_insert_page() is bit
difficult/ have objection.
In some cases, maintainers/ reviewers will not agree to replace
vm_insert_page().
In other scenario, if we change return type of vm_insert_page() to vm_fault_t,
we end up with adding few lines of conversion code from vm_fault_t to errno
in drivers which is not a correct way to go with.
Any suggestion, how to solve this ?
prev parent reply other threads:[~2019-09-06 12:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 18:43 Souptick Joarder
2019-09-05 18:59 ` Matthew Wilcox
2019-09-06 12:24 ` Souptick Joarder [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=CAFqt6zZ_M3_Jr_08SO+OnnurWNbLJJsNZvVDZOnjh88vzaiXGg@mail.gmail.com \
--to=jrdr.linux@gmail.com \
--cc=airlied@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=jglisse@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=peterz@infradead.org \
--cc=rcampbell@nvidia.com \
--cc=thellstrom@vmware.com \
--cc=willy@infradead.org \
/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