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=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 6B385C48BE5 for ; Tue, 22 Jun 2021 18:28:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D6E776128E for ; Tue, 22 Jun 2021 18:28:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6E776128E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C4A636B005D; Tue, 22 Jun 2021 14:28:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF9636B006C; Tue, 22 Jun 2021 14:28:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A26B06B006E; Tue, 22 Jun 2021 14:28:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0020.hostedemail.com [216.40.44.20]) by kanga.kvack.org (Postfix) with ESMTP id 6B5756B005D for ; Tue, 22 Jun 2021 14:28:50 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A122C1807C265 for ; Tue, 22 Jun 2021 18:28:50 +0000 (UTC) X-FDA: 78282196020.29.4E11981 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by imf08.hostedemail.com (Postfix) with ESMTP id 3ED9A8019373 for ; Tue, 22 Jun 2021 18:28:50 +0000 (UTC) Received: by mail-lf1-f41.google.com with SMTP id h15so18941287lfv.12 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=hHcYmy1Nc7ansRtviGLwDP5J/O67Lc6GTfGm9QlwCeUZzrh3Ruj+cga5noVLCHv0ls mh0q6aLota1eGh8Eh77t6aroR9Nru3g7dmRSNDCwhx5NWg5SLdTVYXP5sSXZ2SSBjYTW 72jfl6A9L6TV6SPXMurNkWp9avF2JAhlYuimNUQX/mPM+yVtHpsEiliYr0f8hxlfyWP+ nFmc1faDRdNo1ujg9zAPXe3pdnbfDDfxoTrpv/chibS4wDEqTMJK/4z6OSv2zg/Xq0+W dAlSS8fMq31plEdIlnDhFBOx+BZl82JViq9QWvQI92PZIQO+BWRvDy3hXV2JREKoBiND ETUA== X-Gm-Message-State: AOAM532gcu3UJASfg6QC/hYfn4E+iMZbgDher0Rana9DsR6q22p9r/Tt kkWRypR6A8N+ce1TxiqzOrmOzKjmwAsYHAgo/DM= X-Google-Smtp-Source: ABdhPJy2Z6BHQo4enRDBc0MGTPlE35lItkZJBtexyQ8LAOOAxEgXrYHt8UaT4nJb4OqwXyFezMy+Cg== X-Received: by 2002:ac2:48b8:: with SMTP id u24mr3773770lfg.469.1624386528574; Tue, 22 Jun 2021 11:28:48 -0700 (PDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id a15sm209050lfk.35.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-f169.google.com with SMTP id d2so31508293ljj.11 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" Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=Z693fDgI; dmarc=none; spf=pass (imf08.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.41 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org X-Stat-Signature: pj5qze15qy7drsd6qzojcc8dnt93q75e X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3ED9A8019373 X-HE-Tag: 1624386530-650642 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, 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