[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180904021355.GA17153@bombadil.infradead.org>
Date: Mon, 3 Sep 2018 19:13:55 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Souptick Joarder <jrdr.linux@...il.com>,
Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp>,
Al Viro <viro@...iv.linux.org.uk>,
Theodore Ts'o <tytso@....edu>, adilger.kernel@...ger.ca,
Jens Axboe <axboe@...nel.dk>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Eric Biggers <ebiggers@...gle.com>,
Philippe Ombredanne <pombredanne@...b.com>,
Andreas Gruenbacher <agruenba@...hat.com>,
Greg KH <gregkh@...uxfoundation.org>, kemi.wang@...el.com,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-kernel@...r.kernel.org, linux-ext4@...r.kernel.org,
linux-nilfs <linux-nilfs@...r.kernel.org>
Subject: Re: [PATCH v2] fs: Convert return type int to vm_fault_t
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.
Powered by blists - more mailing lists