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.8 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 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 9F887C48BDF for ; Tue, 22 Jun 2021 18:32:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4607961164 for ; Tue, 22 Jun 2021 18:32:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4607961164 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 2E7C76B005D; Tue, 22 Jun 2021 14:32:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 28EB26B006C; Tue, 22 Jun 2021 14:32:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D397A6B006E; Tue, 22 Jun 2021 14:32:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id 8F4D66B005D for ; Tue, 22 Jun 2021 14:32:18 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C114E1F373 for ; Tue, 22 Jun 2021 18:32:18 +0000 (UTC) X-FDA: 78282204756.37.9EC802F Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by imf23.hostedemail.com (Postfix) with ESMTP id 741B7A002D5E for ; Tue, 22 Jun 2021 18:32:18 +0000 (UTC) Received: by mail-lj1-f170.google.com with SMTP id a16so9966904ljq.3 for ; Tue, 22 Jun 2021 11:32:18 -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=f0pmw5StORP1KUcP15TdiklSXjxFImoIRcmx4+WJzKc=; b=NP4S1TsIF9h2rPtpSgvjlnlXPEzV1Eg6DWYa5iK2q6AtxYQkNIkoYmNrE9B5XO/S4e HF1VEmrSrJFoleJ4FjX+FsvMVqxeW7ygtwWfM8q4P8/YZWbLfBROiuS/kumnsSNRhqqv IWq+2Kwg/HRFdIwqvLmKhyArAFRW+GJQTx+1o= 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=f0pmw5StORP1KUcP15TdiklSXjxFImoIRcmx4+WJzKc=; b=Ks6yiIyjoKJyuG8y1b7xAUTog1w0Ximh6fpiQHKCVf1a/qMvA3qutQWLXXsuZSYgxj ODWoX3lvCqizDNwW925JTzHx3zlcanPDcFtFJHi9xPp2JzOHhUSrlQCsiw1m9NPTX+p6 woCbkB5yEtGvLo3QX/fg5ghjx8jlLdhRXvyz4u1/zSVxjex6Nxm94L38pq4tmKBx5+P0 brJIybTQSfyWHWm3CEMDZeecIYrYVFE6N9R62PjDfB7mArobnDVTBNgjtgqevZ4HXRKH hWH2TLnesR27neYEngzF/ywq2ErxqnmfDAQlxhcsunZtzc210VcjJxXSq+DX7DhsWzIP dqAQ== X-Gm-Message-State: AOAM530e6hOFoA0HMt66EauqZ5sfLCGV5gP5a+w1MTt0aVEm2+Wtnqye FfkH/ItUT0esQNRsVppx4/i0cdzzQwFsJeJaOpE= X-Google-Smtp-Source: ABdhPJz/W3Txtdo4Uk5i0tzf7QMufcduZokKcjyq719+XGCjckJ8mTx3K7E583heU7UJ0Vwf67Q5og== X-Received: by 2002:a05:651c:b1f:: with SMTP id b31mr4375263ljr.488.1624386737033; Tue, 22 Jun 2021 11:32:17 -0700 (PDT) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id br36sm665788lfb.296.2021.06.22.11.32.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Jun 2021 11:32:16 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id f30so37582308lfj.1 for ; Tue, 22 Jun 2021 11:32:16 -0700 (PDT) X-Received: by 2002:a19:7d04:: with SMTP id y4mr3809268lfc.201.1624386736181; Tue, 22 Jun 2021 11:32:16 -0700 (PDT) MIME-Version: 1.0 References: <3221175.1624375240@warthog.procyon.org.uk> <3231150.1624384533@warthog.procyon.org.uk> <3233312.1624386204@warthog.procyon.org.uk> In-Reply-To: <3233312.1624386204@warthog.procyon.org.uk> From: Linus Torvalds Date: Tue, 22 Jun 2021 11:32:00 -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: David Howells Cc: Matthew Wilcox , 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" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 741B7A002D5E Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=NP4S1TsI; spf=pass (imf23.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.170 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Stat-Signature: 7qgcg86dd6jjftj1kxn6wccpmh7bu67u X-HE-Tag: 1624386738-203619 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 David Howells wrote: > > Probably the most obvious way would be to set a flag in task_struct saying > what you're doing and have the point that would otherwise wait for the page to > become unlocked skip to the fault fixup code if the page is locked after > ->readahead() has been invoked and the flag is set, then use get_user() in > iov_iter_fault_in_readable(). Yeah, the existing user access exception handling code _almost_ handles it, except for one thing: you'd need to have some way to distinguish between "prefetch successful" and "fault failed". And yeah, I guess it could be a flag in task_struct, but at that point my gag reflex starts acting up. Linus