Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp742340pxf; Wed, 7 Apr 2021 10:23:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7TuES+THBS2gMhAlusgWUMckLDXxNrhdP/rycSCM79//QWNTJ35nYXO1sGM7mfGxj0CXa X-Received: by 2002:a05:6e02:1a24:: with SMTP id g4mr3393571ile.56.1617816202119; Wed, 07 Apr 2021 10:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617816202; cv=none; d=google.com; s=arc-20160816; b=yk1aEEu28LTMw8jr4Ev9i2KVpXVyKuCzI3fnj6/cbG1VVE4qSTltEsR3LRHXqAnRu+ 70t2TNwPssYPmkrMBKH2ktqNoKQCSFsPGx3gfzT7wJHhiEO2YAlVz02rHrG9le5rdTce j3j31EMitv8lQvRcaKyNZ7MfLN1H3RGTYM5rZ1qt4k3GQv4vbHwRuP8ys3iSn6ZuwOnA Ies5N11dvDieUwZN1cVLaeiC9kLYCQeEUuH6+fVYXTEXtF6yzU+UIXOggBYk5McDs3nR 0Mji8N6xPkiAdVOd+bz3aj4T6laadF+hB3R49rwonLqwVrVHv7fSkcDEWu87+I6N20wL PkiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=v2HTiDurUhaFtku9x3Aod8jwLxk/iaIfkceEVuQR2iU=; b=Vi2ej39O5IdDSkhIfhyCrdq02P49Jal/tBwG7TKuDHsDwCfpdaBYNdZrJphn0zyUs7 8G0gBKYJVsC5yddhF67x5jB2/SWElMmePXPq3VRpriRwaVtdIZv3eDOh5cOYVVUu/fHO d0UlzgwGBBfiQI5RTvN2A8fLSEaEkp0ZQYthN4+twm3TGKesKfU+C3crtH8aCyCfs3bn yuqK3Q2bErE4m62D/rbNKIRse6v0A+YksJjW7mZx/YHd2Md/IblhCiE5mWg++TCm0y1p 1teH5Nkac2C+tgBle/+dAVes0bVinT9oa1/jibte+paOEx+Az323ulMm9ifJOxeJJLj2 ROuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=u3XibzCp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si24816914jat.91.2021.04.07.10.23.09; Wed, 07 Apr 2021 10:23:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=u3XibzCp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343859AbhDGCgn (ORCPT + 99 others); Tue, 6 Apr 2021 22:36:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233994AbhDGCgj (ORCPT ); Tue, 6 Apr 2021 22:36:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 431E2C06174A for ; Tue, 6 Apr 2021 19:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=v2HTiDurUhaFtku9x3Aod8jwLxk/iaIfkceEVuQR2iU=; b=u3XibzCpDyGFKLZZNeLqPUf+Yj K2MaxDOG6QRHihh3SvSIpyISf/sC7iSz/PFCCgXiggJUG+/8yYEC1IU9v7T40IHII6ul12Yo7Lauh LlmUiLOhspkllYcGx1KeBHdUyPdx06f3HCXeGKih+W43Az8YyReJyjl7ekMOuy5nPeYev0/Y/WN6c oOgil/cRFKflduositqm7FIOZeZwFIN2yg6q19hKQ92Wxs+MGdS1UqgRQ5vO/xbh/TBXhpaha943d X7hZfkCg+DT1TtxvsnFj+lmzoQjh6FSYDqumoFCluvyDFInZqxFst1yykAxT7WKK6D94Uo0mOi6tr R65Cs/TA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lTy2R-00Dm0l-9W; Wed, 07 Apr 2021 02:35:31 +0000 Date: Wed, 7 Apr 2021 03:35:27 +0100 From: Matthew Wilcox To: Michel Lespinasse Cc: Linux-MM , Laurent Dufour , Peter Zijlstra , Michal Hocko , Rik van Riel , Paul McKenney , Andrew Morton , Suren Baghdasaryan , Joel Fernandes , Rom Lemarchand , Linux-Kernel Subject: Re: [RFC PATCH 24/37] mm: implement speculative handling in __do_fault() Message-ID: <20210407023527.GX2531743@casper.infradead.org> References: <20210407014502.24091-1-michel@lespinasse.org> <20210407014502.24091-25-michel@lespinasse.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407014502.24091-25-michel@lespinasse.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 06, 2021 at 06:44:49PM -0700, Michel Lespinasse wrote: > In the speculative case, call the vm_ops->fault() method from within > an rcu read locked section, and verify the mmap sequence lock at the > start of the section. A match guarantees that the original vma is still > valid at that time, and that the associated vma->vm_file stays valid > while the vm_ops->fault() method is running. > > Note that this implies that speculative faults can not sleep within > the vm_ops->fault method. We will only attempt to fetch existing pages > from the page cache during speculative faults; any miss (or prefetch) > will be handled by falling back to non-speculative fault handling. > > The speculative handling case also does not preallocate page tables, > as it is always called with a pre-existing page table. I still don't understand why you want to do this. The speculative fault that doesn't do I/O is already here, and it's called ->map_pages (which I see you also do later). So what's the point of this patch?