From: Matthew Wilcox <willy@infradead.org>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: jk@ozlabs.org, arnd@arndb.de, benh@kernel.crashing.org,
paulus@samba.org, mpe@ellerman.id.au,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc: platform: cell: spufs: Change return type to vm_fault_t
Date: Tue, 17 Apr 2018 13:47:12 -0700 [thread overview]
Message-ID: <20180417204712.GB3603@bombadil.infradead.org> (raw)
In-Reply-To: <20180417192038.GA22918@jordon-HP-15-Notebook-PC>
On Wed, Apr 18, 2018 at 12:50:38AM +0530, Souptick Joarder wrote:
> Use new return type vm_fault_t for fault handler. For
> now, this is just documenting that the function returns
> a VM_FAULT value rather than an errno. Once all instances
> are converted, vm_fault_t will become a distinct type.
>
> Reference id -> 1c8f422059ae ("mm: change return type to
> vm_fault_t")
>
> Previously vm_insert_pfn() returns err but driver returns
> VM_FAULT_NOPAGE as default. The new function vmf_insert_pfn()
> will replace this inefficiency by returning correct VM_FAULT_*
> type.
>
> vmf_handle_error is a inline wrapper function which
> will convert error number to vm_fault_t type err.
I think you sent the wrong version of this one ...
The commit message should mention that we're fixing a minor bug, that
the error from vm_insert_pfn() was being ignored and the effect of this
is likely to be only felt in OOM situations.
> @@ -256,11 +257,11 @@ static ssize_t spufs_attr_write(struct file *file, const char __user *buf,
> vma->vm_page_prot = pgprot_noncached_wc(vma->vm_page_prot);
> pfn = (ctx->spu->local_store_phys + offset) >> PAGE_SHIFT;
> }
> - vm_insert_pfn(vma, vmf->address, pfn);
> + ret = vmf_insert_pfn(vma, vmf->address, pfn);
>
> spu_release(ctx);
>
> - return VM_FAULT_NOPAGE;
> + return ret;
> }
I thought I said not to introduce vmf_handle_error(), because it's too
trivial and obfuscates what's actually going on.
> -static int spufs_ps_fault(struct vm_fault *vmf,
> +static inline vm_fault_t vmf_handle_error(int err)
> +{
> + return VM_FAULT_NOPAGE;
> +}
> +
Re-reading spufs_ps_fault(), I wouldn't change anything inside it. Just
change its return type to vm_fault_t and call it done.
next prev parent reply other threads:[~2018-04-17 20:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 19:20 [PATCH] powerpc: platform: cell: spufs: Change return type to vm_fault_t Souptick Joarder
2018-04-17 19:43 ` Arnd Bergmann
2018-04-17 20:47 ` Matthew Wilcox [this message]
2018-04-18 19:04 ` Souptick Joarder
2018-04-18 19:27 ` Matthew Wilcox
2018-04-18 19:33 ` Souptick Joarder
2018-04-18 19:38 ` Matthew Wilcox
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=20180417204712.GB3603@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=jk@ozlabs.org \
--cc=jrdr.linux@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).