Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4948759pxj; Tue, 22 Jun 2021 11:29:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMWmyh3MGu9dLqW8TvFoO9+2S2bZTmH9Ot3yTVasUaAGDeS5sQfz4ogGpZ5qMUw10ESYxx X-Received: by 2002:a17:906:716:: with SMTP id y22mr5622440ejb.266.1624386562259; Tue, 22 Jun 2021 11:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624386562; cv=none; d=google.com; s=arc-20160816; b=VFL1/f2x/cggv9bCum0l5YfsEJbtKKDCwDf90zM6PAOox4R0dzV+tUZFWHanAvVHIj bXNyD4jOFBT+ubm2xBjgu2nYXIJ8vtajMQuBD6ZvXcy7B8SAHsSHCEveggyggBh0TRd9 dlp3HvmmLXue9zzjTr1e0I+J6G5ePBuquVAGtI0Kt4R7Qlbj1y2xnUg3Y63VXJiDaP2c 669FSmXwEVCz8e33b3HugD3IVsOWoYK9VIganJc1waZhvhK+y/11LNry7HgM3MInpXph SJ9JBZdzuKkt3K6ZvWE19gU1wGfh9TkO9meVlfr5ukC0SPOLHh2x1l1gc14sT3Pgpbgo M0CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1ZpVUR22GV2FhIPfitStL6sJNaCS4zKOgFuhT+Jblpo=; b=Dr9QBAw60Jk6kit6NzqZAaSQeZtpSJ7mBZmJrg9TnoPWGwjTMC1lafo0CqgSAendlO m5PtFvYAKZytxI6Z5wwi3akIX5o28DMZoPsKS7XHeWMKcr8SE7BoWxcHVyWjDVvZjcyU jTAVONYE9Cf8ubXByay+9ga6Rud4Y15R1JpB+IMhSCVb8zMGfgnrUsloUATgsgVWJKHv suBEvkKcr3qE2UKpe3Qsd6shDnbbVviNOfDJHWtBrWLML4Zsl6iHoVcaU4bbccHTt5KO NeDLoDOQfEWngVujihBqOEbnZ1kPdbdRYEQ5MlY6k8OkXcLBwBdbnJatQj67NMYiA1VZ 7QBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Z693fDgI; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 j10si14912215ejd.87.2021.06.22.11.28.58; Tue, 22 Jun 2021 11:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@linux-foundation.org header.s=google header.b=Z693fDgI; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232415AbhFVSbH (ORCPT + 99 others); Tue, 22 Jun 2021 14:31:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbhFVSbG (ORCPT ); Tue, 22 Jun 2021 14:31:06 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EF9DC061574 for ; Tue, 22 Jun 2021 11:28:49 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id a11so24465559lfg.11 for ; Tue, 22 Jun 2021 11:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1ZpVUR22GV2FhIPfitStL6sJNaCS4zKOgFuhT+Jblpo=; b=Z693fDgItvtwcb4kTOVryT20g278Zz6hUQqITd0+HePvWOEJ/q4X2/GBHNiKYE5aNZ xF4pSUq8WFx8OrMLW1r42O24+mcof+0hdJXuwaV68w1SsOSyBEhfQWKBUBZM0GfgOc5N g49GS2nhPH9aIUXjg2ss34vZ75Z/DfiJKbz0k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1ZpVUR22GV2FhIPfitStL6sJNaCS4zKOgFuhT+Jblpo=; b=ZpxgFzjJcWx4LUyRXF6nmihYFuMJnUryuRG6bDp7SguTvhZlW467eXKow/YDHwuZRN lTuev/R2+Xa1DxFVOSqX3sKK2XAKu03ry6Vh3hNXnl8n9OXxnsRKTKaQ7Hp2qvlnUQI9 R24yc4iYX5fz/ZcVL97bpEyUzkLC8djV24UTGF+PsstfRH4u6UqPB7D7JpN0lTqMbbxG SV2gDGDGb+N+zS5+xgMLsBWlwV877ilM5qhSJMZyUjMKS88qTrxPbXRm2CPUPQzWET2o WhmhFXBpldkimd9IX5f976iVb/AmUaamC5CoXhT0/24DB7N2SgMFYZjZiP08Ioz6dLLd 9E0g== X-Gm-Message-State: AOAM532exdOH3/9A6S6AGdCJYVBKaK95gWH1ohRwjEXV9PvERwDIKKxS BQQ0yvT+kA3JsAd32u9EP52OeWRHT57BFTw0gIo= X-Received: by 2002:a05:6512:169b:: with SMTP id bu27mr3970648lfb.327.1624386527642; Tue, 22 Jun 2021 11:28:47 -0700 (PDT) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id p5sm14341ljn.109.2021.06.22.11.28.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Jun 2021 11:28:47 -0700 (PDT) Received: by mail-lj1-f174.google.com with SMTP id k8so31297470lja.4 for ; Tue, 22 Jun 2021 11:28:47 -0700 (PDT) X-Received: by 2002:a2e:b618:: with SMTP id r24mr4383026ljn.48.1624386526776; Tue, 22 Jun 2021 11:28:46 -0700 (PDT) MIME-Version: 1.0 References: <3221175.1624375240@warthog.procyon.org.uk> <3231150.1624384533@warthog.procyon.org.uk> In-Reply-To: From: Linus Torvalds Date: Tue, 22 Jun 2021 11:28:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Do we need to unrevert "fs: do not prefault sys_write() user buffer pages"? To: Matthew Wilcox Cc: David Howells , Al Viro , "Ted Ts'o" , Dave Hansen , Andrew Morton , Linux-MM , Ext4 Developers List , linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Jun 22, 2021 at 11:23 AM Matthew Wilcox wrote: > > It wouldn't be _that_ bad necessarily. filemap_fault: It's not actually the mm code that is the biggest problem. We obviously already have readahead support. It's the *fault* side. In particular, since the fault would return without actually filling in the page table entry (because the page isn't ready yet, and you cannot expose it to other threads!), you also have to jump over the instruction that caused this all. Doable? Oh, absolutely. But you basically need a new inline asm thing for each architecture, so that the architecture knows how to skip the instruction that caused the page fault, and the new exception table entry type to say 'this is that magic VM prefetch instruction". So filemap_fault() is the least of the problems. Honestly, it doesn't look _complicated_, but it does look like a fair number of small details.. Linus