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 9876CC433B4 for ; Wed, 7 Apr 2021 14:40:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 17EA5600D4 for ; Wed, 7 Apr 2021 14:40:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17EA5600D4 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 7C6286B0080; Wed, 7 Apr 2021 10:40:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7765E6B0081; Wed, 7 Apr 2021 10:40:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C82A6B0082; Wed, 7 Apr 2021 10:40:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id 3C9916B0080 for ; Wed, 7 Apr 2021 10:40:46 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DFCE7688B for ; Wed, 7 Apr 2021 14:40:45 +0000 (UTC) X-FDA: 78005832450.34.407BDB4 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf06.hostedemail.com (Postfix) with ESMTP id 4E130C0007D2 for ; Wed, 7 Apr 2021 14:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=6m40cToXPgyDu2b8MrQF6FFVIzoneD5MfUmSB8MTpFk=; b=l4CK2vad/9tSVNg4Y026tKsp1h eKVbpKb2o4+nZtrWqKSyNlHAFM/ZZZe6gUIADR8knHWkRPZorFxw3UCeLkxwlBdDhHKJkRa4kre/b JT9/qaI0RULGD7x4LotLUBZOUCYcaCGmTVZwU89TH/EirXrp+esodhGKcFqntBFr4LaN6pLGsoyJr vA1HOZvMU81+uGAEV8l/kU3u544XDUpK5I0fCy1pSmDI2RGVg6MN/pS/ZRSD1Add4+8RCHxuCC6fb itNPqTwquEso7QSHHNhCaAzoPBCkWTg3L+GmTfRZY+w5Ucb6iCZrY5ohDkjdc8v7B/NNCDAltcdw4 cwnqWjcQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lU9MB-005BV7-Vc; Wed, 07 Apr 2021 14:40:36 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1D025300056; Wed, 7 Apr 2021 16:40:35 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id ED28323D3AF82; Wed, 7 Apr 2021 16:40:34 +0200 (CEST) Date: Wed, 7 Apr 2021 16:40:34 +0200 From: Peter Zijlstra To: Michel Lespinasse Cc: Linux-MM , Laurent Dufour , Michal Hocko , Matthew Wilcox , 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: 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-Server: rspam05 X-Rspamd-Queue-Id: 4E130C0007D2 X-Stat-Signature: qyzc49g9qn1jbbnqhbsa434d41ijf8yz Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=desiato.infradead.org; client-ip=90.155.92.199 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617806446-486840 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. So what's wrong with SRCU ? Laurent mumbled something about frequent SRCU kthread activity being a problem; is that still so and is that fundamentally unfixable? Because to me it seems a much more natural solution to the whole thing.