Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2101244imm; Mon, 3 Sep 2018 19:15:38 -0700 (PDT) X-Google-Smtp-Source: ANB0VdavsuuwUJQXPzz3gcDKWQkvKlxdH7Z2wopaHhUYWRHEwlyCXB9AAkJWCP18V0pxuyTgSEbK X-Received: by 2002:a63:5e45:: with SMTP id s66-v6mr28934771pgb.151.1536027338832; Mon, 03 Sep 2018 19:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536027338; cv=none; d=google.com; s=arc-20160816; b=TkTeYEFBPokR4jVIFQjrUwc+guH5M1c6igCPB0wJNwNxezoOEtY8HD+/wUHB5zbbZH CCrANg82fi7bG5b9EepBbejddgF2ycqpmlbivjrksH/3kf2POpFu9wiAZMCkyP16PZUz CxX4/X3k0OtfIL8kqrtZnoG2XkameGXfDVdmlBpcksYMiEq23BjTQnRr9nRcSZtmH4aY 1CKN2KeTtyAcGve1lju/MVxYjrdUi0kFzsLKTGVGU6InejjfjB43pk3fzymDlJOXmVvy yGIRDLrBnClH4QttuL4WSQI9AXNxBnLn23jlo2LcENz+1httq1nXvK9cNiqmwiHFK3LE bKVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=SwYoOGTJwPltXecgxvvFyCWLNUO+6wrT3VFzYnirq90=; b=pr5owfkkCyVGFFee4THMwoVHZBLHGpNCuMQ39mjgKc/5sV/IhMp+6kk3i3A6fl6MJb K0uacOHIQ/2OfMebnJzJo30gGhDCChlLJP/Xy6s/CVRSZYWRBmVZrCuu3ae8GMqsmUAN QMpgNTU6NQg4D+na219C8sAg95eAep8HJo8UAcIHSVUTpDtPp4LKlLkd72Kujbw928/i 4yOpYSjsZILhUc8UwEN+g1Feru/BzLEoEIi1hx4KuibdjXSAX4XxSzvHvM4onGkcjefg ZXRHUD0T3xR2gvjLOFHvakSToFiFA6IWI8Hx9ueTPC91qnWLHWwPoPHAhr9k0OJpafun ZkjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FcUEBftW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g66-v6si21144384pfk.53.2018.09.03.19.15.23; Mon, 03 Sep 2018 19:15:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FcUEBftW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726263AbeIDGhG (ORCPT + 99 others); Tue, 4 Sep 2018 02:37:06 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35660 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbeIDGhG (ORCPT ); Tue, 4 Sep 2018 02:37:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SwYoOGTJwPltXecgxvvFyCWLNUO+6wrT3VFzYnirq90=; b=FcUEBftWkg8yZudRxA/nXSTAi sq6mmY/0m8yA+p6ym4U3wJ24RQRzQhZBNpD2bBVAIYXkH8z7WHuQfNxgIOVxhzyqAW7asvEY258iJ uI0gFe8A0U9rXLY5pFt7xMiSZ4MBCprbTNnSkIA2mLirT9k8S91at0XgWSA5O3tjtNaP5JkkVc1np PkTP2PqX39TutDJod9r94SN5DeDXg94lDmm3uhWYYNvtyaW7WRN0YbUpqOQozTM4FgI7RrT7GCsTU gREakDcDgplU/NdrQbXfxVa4JsEyFstTnF/X97JmCL3gOU1Y+1poqauBDrrZf27OWwc5ASA5W8ubU slktM+RwA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fx0qp-0001OF-Qv; Tue, 04 Sep 2018 02:13:55 +0000 Date: Mon, 3 Sep 2018 19:13:55 -0700 From: Matthew Wilcox To: Andrew Morton Cc: Souptick Joarder , Ryusuke Konishi , Al Viro , Theodore Ts'o , adilger.kernel@dilger.ca, Jens Axboe , "Darrick J. Wong" , Eric Biggers , Philippe Ombredanne , Andreas Gruenbacher , Greg KH , kemi.wang@intel.com, linux-fsdevel , linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nilfs Subject: Re: [PATCH v2] fs: Convert return type int to vm_fault_t Message-ID: <20180904021355.GA17153@bombadil.infradead.org> References: <20180830172547.GA4408@jordon-HP-15-Notebook-PC> <20180830163352.5a96cc721ce069bed95fdbe8@linux-foundation.org> <20180903172843.9bf312c738ce8a434dd9c242@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180903172843.9bf312c738ce8a434dd9c242@linux-foundation.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.