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, NICE_REPLY_A,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 7C5A2C433DB for ; Wed, 3 Mar 2021 20:13:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C568F64EDC for ; Wed, 3 Mar 2021 20:13:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C568F64EDC 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 24A5A6B0005; Wed, 3 Mar 2021 15:13:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D4016B0006; Wed, 3 Mar 2021 15:13:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 04C1A6B0007; Wed, 3 Mar 2021 15:13:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id D8A1F6B0005 for ; Wed, 3 Mar 2021 15:13:18 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8A3958249980 for ; Wed, 3 Mar 2021 20:13:18 +0000 (UTC) X-FDA: 77879662476.27.D0DEAB5 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf05.hostedemail.com (Postfix) with ESMTP id D1A2BE016148 for ; Wed, 3 Mar 2021 20:13:08 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 55FA364EE7; Wed, 3 Mar 2021 20:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1614802374; bh=Xr/eJPdOmWhLdpnQyVVA+xkU185rLwaj41waSYr6VAs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=V/eX1k7WlMR9lAcOp/w4yS8wqhnK3VY5Z3ZfAOr3g2LhlNIGbbMr/fzo5oVkdmyqt ZyvnYZmGXZ8RBBa5oxrRG8d7cUV5PfloPM0pJASQU4NxdtFLy7aL+yqh+tW6oDjm5R vazbDg7Ip6MThebfdhPuK3QzZEXqg7Khb618h4Wo= Date: Wed, 3 Mar 2021 12:12:53 -0800 From: Andrew Morton To: Matthew Wilcox Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Kent Overstreet , Christoph Hellwig Subject: Re: [PATCH] mm/filemap: Use filemap_read_page in filemap_fault Message-Id: <20210303121253.9f44d8129f148b1e2e78cc81@linux-foundation.org> In-Reply-To: <20210303132640.GB2723601@casper.infradead.org> References: <20210226140011.2883498-1-willy@infradead.org> <20210302173039.4625f403846abd20413f6dad@linux-foundation.org> <20210303013313.GZ2723601@casper.infradead.org> <20210302220735.1f150f28323f676d2955ab49@linux-foundation.org> <20210303132640.GB2723601@casper.infradead.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D1A2BE016148 X-Stat-Signature: qf15exsecp5prfzznnua55ubjadj53ss Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614802388-152267 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 Wed, 3 Mar 2021 13:26:40 +0000 Matthew Wilcox wrote: > But here's the thing ... invalidate_mapping_pages() doesn't > ClearPageUptodate. The only places where we ClearPageUptodate is on an > I/O error. yup. > So ... as far as I can tell, the only way to hit this is: > > - Get an I/O error during the wait > - Have another thread cause the page to be removed from the page cache > (eg do direct I/O to the file) before this thread is run. > > and the consequence to this change is that we have another attempt to > read the page instead of returning an error immediately. I'm OK with > that unintentional change, although I think the previous behaviour was > also perfectly acceptable (after all, there was an I/O error while trying > to read this page). > > Delving into the linux-fullhistory tree, this code was introduced by ... > > commit 56f0d5fe6851037214a041a5cb4fc66199256544 > Author: Andrew Morton > Date: Fri Jan 7 22:03:01 2005 -0800 > > [PATCH] readpage-vs-invalidate fix > > A while ago we merged a patch which tried to solve a problem wherein a > concurrent read() and invalidate_inode_pages() would cause the read() to > return -EIO because invalidate cleared PageUptodate() at the wrong time. > > We no longer clear PageUptodate, so I think this is stale code? Perhaps > you could check with the original author ... Which code do you think might be stale? We need the !PageUptodate check to catch IO errors and we need the !page->mapping check to catch invalidates. Am a bit confused.