Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4677089imm; Fri, 18 May 2018 08:54:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqbO6QsO5eXTBCRK/ZSrV7j0xtzLMMjQ06PLse2oNQEAQL8J5fZIvfRvhkVkUF3KmJ5N976 X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr9976367plz.336.1526658840160; Fri, 18 May 2018 08:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526658840; cv=none; d=google.com; s=arc-20160816; b=sgc91gT/nQ5YS5WA1fC0WSXXnjqeVDMOGipcymWJMhmb7cNdD46XfDzSrNouULsbsy 83YSMzDfBS1HkUrLfPM57ITlX4gNF0rZlcem9P17xWDSucQBxcLqzQ1N7N5BlFN053dM JScksSchVDds3H+D8Qgsqc9WeqM7qAaYX8aHcz3/0KkGYSvKVrxCm2ChogltAbuVuTEj YZ3FHhNpjmHwUyLn6bSDjiBo+vTxfS04zJlHKB5QQgXNI9GPPuCewUq2iXJYrZFS1KQq HbihsnilYLuf+mEs8S1rZNa8eFBe2FL8h7qZCm9bANqbj9xmH8Hd/ZeViqmgcJ8+TcS7 OeNw== 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=/U16B12GOdxyRWj6HRiBMV4h1wwGZc2Jb7NDGb0k1QY=; b=J2Gzsp3SylFMvxdEQXUSc8RVYtqHLJAsV+OglfQeRZnKP+79KubPxPhyWInALuwxAP cGlTaJpTCgLfy5P5jeCTcieiPecCslAdV3KjzR7HtghqwsyhZCQjMdYTCjLRfq9HphnE zWHVLzAhw4NUXhFztdh/qI7N3wV3OiFe6GAz16Uu/wlZAk2OINO8KH9Ur5S4Fz+u8a3v W7YiE3+Wn8g/0dmThb20EKTS5mRlZQxGzvt3WKjY8f2jtCrzCvlyvico6eDbPCel/kIs f6fAo2CLIoZZHGP2U3xHuebRQQtxxRd4cA2w0uVpR/ZacMV3hncucIZCwLt1o6jGzrp5 hSWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=c6AT03oh; 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 73-v6si7827357pfh.315.2018.05.18.08.53.45; Fri, 18 May 2018 08:54:00 -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=c6AT03oh; 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 S1752163AbeERPxd (ORCPT + 99 others); Fri, 18 May 2018 11:53:33 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57332 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957AbeERPxb (ORCPT ); Fri, 18 May 2018 11:53:31 -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=/U16B12GOdxyRWj6HRiBMV4h1wwGZc2Jb7NDGb0k1QY=; b=c6AT03ohc0D8UwvDFxtu11UCe UhfUv8MxesBl0vGK3VJafppBJa6MDgecOo4R52u8/IYufvzsSE6xYkRjO/wVR7kJ8Uwqj/HYKcqIW UfYsI+rzOQfa2sun4NOVyLDJeundJpauSjA39JbO5cPOfhOBS+aS2gucurHNhplWxhrgb0a+dUMP8 rHkNQgRLLt2ZdUxBWX2DuZHx4S0OkIx+JVv67u/6HkBIJwfC2udKfFrzD3R/KvTGjiPxZQcSu6UrO ZkVaqkowWYLCCwzrf41ZK8QF1M6k5W7AWqBnBhbtCG7aOvN7Q8lty94jXKOx9uPlCt1Eaf+G1BXFQ VZX6pjyGQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJhhC-0004Uk-9i; Fri, 18 May 2018 15:53:30 +0000 Date: Fri, 18 May 2018 08:53:30 -0700 From: Christoph Hellwig To: Matthew Wilcox Cc: Kent Overstreet , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Dave Chinner , darrick.wong@oracle.com, tytso@mit.edu, linux-btrfs@vger.kernel.org, clm@fb.com, jbacik@fb.com, viro@zeniv.linux.org.uk, peterz@infradead.org Subject: Re: [PATCH 01/10] mm: pagecache add lock Message-ID: <20180518155330.GA16931@infradead.org> References: <20180518074918.13816-1-kent.overstreet@gmail.com> <20180518074918.13816-3-kent.overstreet@gmail.com> <20180518131305.GA6361@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180518131305.GA6361@bombadil.infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 18, 2018 at 06:13:06AM -0700, Matthew Wilcox wrote: > > Historically, the only problematic case has been direct IO, and people > > have been willing to say "well, if you mix buffered and direct IO you > > get what you deserve", and that's probably not unreasonable. But now we > > have fallocate insert range and collapse range, and those are broken in > > ways I frankly don't want to think about if they can't ensure consistency > > with the page cache. > > ext4 manages collapse-vs-pagefault with the ext4-specific i_mmap_sem. > You may get pushback on the grounds that this ought to be a > filesystem-specific lock rather than one embedded in the generic inode. Honestly I think this probably should be in the core. But IFF we move it to the core the existing users of per-fs locks need to be moved over first. E.g. XFS as the very first one, and at least ext4 and f2fs that copied the approach, and probably more if you audit deep enough.