From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BB98C433ED for ; Wed, 7 Apr 2021 02:35:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 99E56613AF for ; Wed, 7 Apr 2021 02:35:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99E56613AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AF70A6B0092; Tue, 6 Apr 2021 22:35:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA6DE6B0093; Tue, 6 Apr 2021 22:35:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 949966B0095; Tue, 6 Apr 2021 22:35:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id 76FCA6B0092 for ; Tue, 6 Apr 2021 22:35:53 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3B8C3362E for ; Wed, 7 Apr 2021 02:35:53 +0000 (UTC) X-FDA: 78004005786.07.30DC5D6 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id 8528B40002C4 for ; Wed, 7 Apr 2021 02:35:49 +0000 (UTC) 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> X-Rspamd-Queue-Id: 8528B40002C4 X-Stat-Signature: 17sxek8q8e3stwgr4oce6xyf6uybg8yh X-Rspamd-Server: rspam02 Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf10; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617762949-334617 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?