Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3374115yba; Tue, 23 Apr 2019 02:40:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyO3ty7lAZyDcPJP8KgwvnB+XjZHnNAiBX6ow8LQuJfVfOXtvEn6TnDbIbew5ftkPLR8Q1z X-Received: by 2002:a62:4d44:: with SMTP id a65mr2250817pfb.150.1556012428190; Tue, 23 Apr 2019 02:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556012428; cv=none; d=google.com; s=arc-20160816; b=i5o6LkJZCcRvploCqs/XPD/WL4VvPHMzA2NfE4HBXO7YrCNC9O477cPfkDHfYBl4Uk KwlcsjOXNUM0XwlrjDW3vYiaPXwMqZwpzzQsfi+uO/nT9C9zse9Y330dp/mMJWwANTSt jQbJwkzoFDHCsiL49pUQqyzo2FPaSE3op7dzAHIvvKKxVAkeaWrUB6DPpuev5fp4DjNg cJpAE64c0d3MU1pxEALnYdOUX38dUMA311+hY5SAQ54bOotfSUb+Djp7wxRKf767U07N 3WFyDBuRmeZdEgiCUGGy/sO+w0ymAoITGuW6+HWkGZ+XM2RPfTNo2Fcm9TdLVd8/enXU B+wA== 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; bh=KZ1+LpzJjt1lQaO/zhhBXmd8ItG9I8H/NFkBPqdSKp4=; b=mc7bTWu/+GrtrA59t7/jtgYgim5WfIYf8hsSHNDN7oEVV1ZYLfrMg9ipr9AkkzNorT rFINpKO+n200smBTXj5NjjiwiDRnh+8+lWtDlfph/FG7w6zzVieu1g1UA1afg1NOiBEC QpajBcIONJcOeUNLwgnlQfH62BHqa58o4fDTE0QcJFIMm6VOU++m50g7Lrk43O9rO5f/ 1hhcK0bpJ6u8cw6umUVh9ntU6WvgdOrB8mZP90wGV+bteKhU46ERqx0vhsuX48rZGq3z 17/J5KVloSvAZXq2oWSz167c78nwgi1T6kez+c42tM4o7M1/1f4zo3cHPGh4TJR3mKN/ sPaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kWZNVI2H; 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 g37si16412644plb.180.2019.04.23.02.40.12; Tue, 23 Apr 2019 02:40:28 -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=kWZNVI2H; 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 S1726691AbfDWJjV (ORCPT + 99 others); Tue, 23 Apr 2019 05:39:21 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46250 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfDWJjU (ORCPT ); Tue, 23 Apr 2019 05:39:20 -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=KZ1+LpzJjt1lQaO/zhhBXmd8ItG9I8H/NFkBPqdSKp4=; b=kWZNVI2H88CgPB45rHhvEagQy YUXAwoj4UqliNhOdCXov/GLt6lWALi4JYUG0WNlU4GGG3JAvPyBRkffyWJOG+EG0Ur9Kx1yB1ZEA+ crqGIkZ0RR5dJvoHX2bSDFkFQfGDGgb5JKkpIhgWbRSNdH1EQU51xgOLzcuH2d142hpvgjzx2md9s rcVXo+iDvqNoRr/AvulifTy23sAkOmmfbsKuOe7LAQCmEVmiq9pYQuCW4a42z6Hp8dQhMHJiCING8 JI1Nlc06RH+pKcvLROVBIO1pkNJZOFlAGmkC/NPAI0mOHNypwGzvg0dMbMU4fZTqeqtbbpL0yyKJd YyIrsQdsw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hIrt8-0003WC-3I; Tue, 23 Apr 2019 09:38:55 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6922229B47DCF; Tue, 23 Apr 2019 11:38:51 +0200 (CEST) Date: Tue, 23 Apr 2019 11:38:51 +0200 From: Peter Zijlstra To: Michel Lespinasse Cc: Laurent Dufour , Andrew Morton , Michal Hocko , "Kirill A. Shutemov" , Andi Kleen , dave@stgolabs.net, Jan Kara , Matthew Wilcox , aneesh.kumar@linux.ibm.com, Benjamin Herrenschmidt , mpe@ellerman.id.au, Paul Mackerras , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Will Deacon , Sergey Senozhatsky , sergey.senozhatsky.work@gmail.com, Andrea Arcangeli , Alexei Starovoitov , kemi.wang@intel.com, Daniel Jordan , David Rientjes , Jerome Glisse , Ganesh Mahendran , Minchan Kim , Punit Agrawal , vinayak menon , Yang Shi , zhong jiang , Haiyan Song , Balbir Singh , sj38.park@gmail.com, Mike Rapoport , LKML , linux-mm , haren@linux.vnet.ibm.com, Nick Piggin , "Paul E. McKenney" , Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: Re: [PATCH v12 00/31] Speculative page faults Message-ID: <20190423093851.GJ11158@hirez.programming.kicks-ass.net> References: <20190416134522.17540-1-ldufour@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, Apr 22, 2019 at 02:29:16PM -0700, Michel Lespinasse wrote: > The proposed spf mechanism only handles anon vmas. Is there a > fundamental reason why it couldn't handle mapped files too ? > My understanding is that the mechanism of verifying the vma after > taking back the ptl at the end of the fault would work there too ? > The file has to stay referenced during the fault, but holding the vma's > refcount could be made to cover that ? the vm_file refcount would have > to be released in __free_vma() instead of remove_vma; I'm not quite sure > if that has more implications than I realize ? IIRC (and I really don't remember all that much) the trickiest bit was vs unmount. Since files can stay open past the 'expected' duration, umount could be delayed. But yes, I think I had a version that did all that just 'fine'. Like mentioned, I didn't keep the refcount because it sucked just as hard as the mmap_sem contention, but the SRCU callback did the fput() just fine (esp. now that we have delayed_fput).