linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Souptick Joarder <jrdr.linux@gmail.com>,
	Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>,
	Al Viro <viro@zeniv.linux.org.uk>, Theodore Ts'o <tytso@mit.edu>,
	adilger.kernel@dilger.ca, Jens Axboe <axboe@kernel.dk>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	Eric Biggers <ebiggers@google.com>,
	Philippe Ombredanne <pombredanne@nexb.com>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	kemi.wang@intel.com,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-nilfs <linux-nilfs@vger.kernel.org>
Subject: Re: [PATCH v2] fs: Convert return type int to vm_fault_t
Date: Mon, 3 Sep 2018 19:13:55 -0700	[thread overview]
Message-ID: <20180904021355.GA17153@bombadil.infradead.org> (raw)
In-Reply-To: <20180903172843.9bf312c738ce8a434dd9c242@linux-foundation.org>

On Mon, Sep 03, 2018 at 05:28:43PM -0700, Andrew Morton wrote:
> > > I'm beginning to feel vm_fault_t exhaustion.  Please remind me what
> > > benefit we're going to get out of all this churn?

Hi Andrew,

The primary benefit is to help driver writers.  At the moment, there
is nothing to stop them returning -ENOMEM instead of VM_FAULT_NOMEM.
There were one or two examples of this in the tree, but I think they're
all gone now.

Secondarily, there are a number of places which translate between error
codes and vm_fault codes.  Those places are reduced as a result of these
patches, if not entirely eliminated yet.  There was some pretty extreme
cargo-culting of errno to vm_fault switch statements, particularly in
the DRM drivers.

There were also several places which were just ignoring the return value
of vm_insert_foo(), and as a result of this audit, those have been fixed.
Those errors are going to be rare, but can cause inappropriate decisions
to be made by the OOM killer.

Now that I think about it, vmf_insert_foo() should probably get marked
with __must_check to prevent those kinds of errors from being introduced
again.

  reply	other threads:[~2018-09-04  6:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 17:25 [PATCH v2] fs: Convert return type int to vm_fault_t Souptick Joarder
2018-08-30 23:33 ` Andrew Morton
2018-08-31  6:03   ` Souptick Joarder
2018-09-04  0:28     ` Andrew Morton
2018-09-04  2:13       ` Matthew Wilcox [this message]
2018-09-03  2:13   ` Ryusuke Konishi
2018-09-03 11:58     ` Souptick Joarder
2018-08-30 23:35 ` Andrew Morton
2018-08-31 16:58   ` Theodore Y. Ts'o
2018-09-01 16:21     ` Souptick Joarder
2018-09-03  4:49 ` 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=20180904021355.GA17153@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=agruenba@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=darrick.wong@oracle.com \
    --cc=ebiggers@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jrdr.linux@gmail.com \
    --cc=kemi.wang@intel.com \
    --cc=konishi.ryusuke@lab.ntt.co.jp \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=pombredanne@nexb.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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).