Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4799087ybv; Wed, 26 Feb 2020 03:18:59 -0800 (PST) X-Google-Smtp-Source: APXvYqyxRnqti2BeoneelOU2Ws+igHssH/FmqA/M/EBsH1SgQ3D7ALBF86moheL709jqGdiQmSti X-Received: by 2002:a05:6808:b39:: with SMTP id t25mr2662611oij.71.1582715939250; Wed, 26 Feb 2020 03:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582715939; cv=none; d=google.com; s=arc-20160816; b=yC+1YIE440PMNlqZjldQOjShsZkpxRjfW6ydmWwffEw7Y0O4xWxNDZw8CChxwpMF1N 8LdxhjN9xy1NF2WiP1C/NnLU5lokJO8/4dQsAthCJduD/dDCUXNfyb9/+IcMBHw0pVJp 3Rz8S7NDB8RRvlbbKyhIt9qs61/gPAxoze5OEOO6Z1ImoaQJeEs4xAxBAPoj8Uv5QLu3 9l4Dl9Qqt6CGPictLIl9mxLmSQpeLoloCSgbMuxTjLAkMlOZbnq8AOwuEtok36RB6iPA jpqx28xDzVNdslm1j3XgVD5GijKreeVZBtnvVUu1+RQCMbHKj4YcU3tUVrCPaAzmUJZs 14sw== 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; bh=s48c3o3RivtlSTnhFGB3jpxY5c0TbStyaPnL/9jA1X8=; b=QG2Z+uCWSGLzCMiNekRtXEZDKZ4dHncqFEjWoaMuYtgj5o0tnFFqctHBbif9hmWNyr NMRxrQLzqi8BmVDG2HdWiToK6B8NXrVpNELX7i+fOFFkB2nigOzOnbABScBBPot4kfhC ac63VVmjAKsiSpYNysdq1r+2hARFbF6CFRXuA5JMZdSNiwxUhfWdaHYpLunt50SvLIMc P0BWQ9Gdlo225pUdWttT6N5ibOWq3QIwpomqu6/vjjuT5AnPv3m1lx1OUt704+rLdVRA LaqWN1Ek9BdW047psoQRdvDyNLlzfvhv5NrsGElS2TrTt1H26dspGRafusVnrpMcueZ4 jNRQ== ARC-Authentication-Results: i=1; mx.google.com; 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 x20si967347oix.155.2020.02.26.03.18.47; Wed, 26 Feb 2020 03:18:59 -0800 (PST) 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; 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 S1728240AbgBZLRn (ORCPT + 99 others); Wed, 26 Feb 2020 06:17:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:58540 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbgBZLRn (ORCPT ); Wed, 26 Feb 2020 06:17:43 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4917FACCE; Wed, 26 Feb 2020 11:17:41 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 9D3F61E0EA2; Wed, 26 Feb 2020 12:17:40 +0100 (CET) Date: Wed, 26 Feb 2020 12:17:40 +0100 From: Jan Kara To: Dave Chinner Cc: Christoph Hellwig , ira.weiny@intel.com, linux-kernel@vger.kernel.org, Alexander Viro , "Darrick J. Wong" , Dan Williams , "Theodore Y. Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH V4 07/13] fs: Add locking for a dynamic address space operations state Message-ID: <20200226111740.GF10728@quack2.suse.cz> References: <20200221004134.30599-1-ira.weiny@intel.com> <20200221004134.30599-8-ira.weiny@intel.com> <20200221174449.GB11378@lst.de> <20200221224419.GW10776@dread.disaster.area> <20200224175603.GE7771@lst.de> <20200225000937.GA10776@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200225000937.GA10776@dread.disaster.area> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 25-02-20 11:09:37, Dave Chinner wrote: > /me wonders if the best thing to do is to add a ->fault callout to > tell the filesystem to lock/unlock the inode right up at the top of > the page fault path, outside even the mmap_sem. That means all the > methods that the page fault calls are protected against S_DAX > changes, and it gives us a low cost method of serialising page > faults against DIO (e.g. via inode_dio_wait()).... Well, that's going to be pretty hard. The main problem is: you cannot lookup VMA until you hold mmap_sem and the inode is inside the VMA. And this is a fundamental problem because until you hold mmap_sem, the address space can change and thus the virtual address you are faulting can be changing inode it is mapped to. So you would have to do some dance like: lock mmap_sem lookup vma get inode reference drop mmap_sem tell fs about page fault lock mmap_sem is the vma still the same? And I'm pretty confident the overhead will be visible in page fault intensive workloads... Honza -- Jan Kara SUSE Labs, CR