Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp883877pxf; Wed, 7 Apr 2021 14:06:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWFTzkCMvi6wKCWQO2aj4gIPHUwPrC6m2w4S/PVHlHrbquTc1EcXcQWCiYkwwsJTQ87B1s X-Received: by 2002:a05:6402:4314:: with SMTP id m20mr6770449edc.5.1617829568898; Wed, 07 Apr 2021 14:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617829568; cv=none; d=google.com; s=arc-20160816; b=FtPkfrN4wf0mXwfkZytZyQMVrTvwqizt1SgFX78q5h9BwyIA0hAbbLTSIpbsQSE5HL z58w1ugVG/jaBWQIX0Sxdy4XVZssbVzCNv2g8LZmkIfT7gAYkiFi0Y5z/3VbFkHp9NTv POBQt7idSwJ+N+6nHPsSiCpIlo1x99nHlNy8znocHVdflFMeuI5bkP5Mc29yDdYlR98n Sm2fjFVF/Bo3Q6mhB0qhI60pz0MSyOu6rG67nbgugk9AYihakBxLO44GHWHHT4vX8h4Q geaU8H4jomIBCNzrwJWFVzPkDMFozQ9wfAs6mNUMG8VuWRtISvUVsvxCS3q7dNipNvt6 4B0g== 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=6m40cToXPgyDu2b8MrQF6FFVIzoneD5MfUmSB8MTpFk=; b=eABr8uIUCcH+eAs3NwYvOP/6dTLhml9wD1ok/esEeH6i5Pz1yrMfS3+7fX+/Jp/o7k J/Z2E3rS5m2CqiUUHuEHp3gNjZFxMM7VBX8eMgN13yfi1jIQFywTWv/h9qHu64pBIxQG sz37D0TOlCjYWul+az//dvG7BBvLbgTsThGidM1xLwA1IZiAkJLht+9QrrQar/nX8OD9 35e7oDLzjBWLvUCzSzL+1moxOjXK/TTDCfoPdkKWKYZ8nkk1+wntfVLTiDDmyWAQ2m5L 4lLSMzfd9ZdZW0N+hpAMPnOqxnuxd+33kw4quaElvY48lIldl2bZ5e3grAja8zrwZhzi SZFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=l4CK2vad; 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 c21si1384988edv.530.2021.04.07.14.05.45; Wed, 07 Apr 2021 14:06:08 -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=desiato.20200630 header.b=l4CK2vad; 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 S235768AbhDGOlJ (ORCPT + 99 others); Wed, 7 Apr 2021 10:41:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234886AbhDGOlI (ORCPT ); Wed, 7 Apr 2021 10:41:08 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D2FC061756 for ; Wed, 7 Apr 2021 07:40:58 -0700 (PDT) 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> 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. 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.