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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 61DC1C433E7 for ; Thu, 15 Oct 2020 11:50:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 89F41212CC for ; Thu, 15 Oct 2020 11:49:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="VixR6nbu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89F41212CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BCE4F94000C; Thu, 15 Oct 2020 07:49:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B7FA0900002; Thu, 15 Oct 2020 07:49:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A957F94000C; Thu, 15 Oct 2020 07:49:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 7F348900002 for ; Thu, 15 Oct 2020 07:49:58 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 01A32180AD811 for ; Thu, 15 Oct 2020 11:49:58 +0000 (UTC) X-FDA: 77373990876.05.day42_1e0ff5e27214 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id D5BEB1826B6AB for ; Thu, 15 Oct 2020 11:49:57 +0000 (UTC) X-HE-Tag: day42_1e0ff5e27214 X-Filterd-Recvd-Size: 3311 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Thu, 15 Oct 2020 11:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=XLRuihqm3fAlHyAROY0lvBAgKqxOu9ggAgyL2LNoHgw=; b=VixR6nbubUCnsr4ZO2wy9wuxCn lduZ4bu+AY2nVEOKTBe3JvtWf0PlYzWVbpiellQE6WWeKJ46G0qRMjoBJK9Zqxld+20RhqXCyTXW8 iIJ7jl6BzmDlIQEHhkYHBhTOphSFccJhtJ7PpwARQc60tLRYyOXI9J4I06bLQgXnncAM+vpCMN1TW moWLhI0VJd33AOfpSmp24xN24NWqTOcT4f7uyXVJtcRgmtAdi8WW/5Tj8q5TbdPOmTEfJAcHjHHpN vx2Me/S+s+qLI0dsDRm2ZiSRjkSNyE2miUVgJCU5cSIyqF0lNfp5SeuzMdGwwLIvbsLqhY94JNLFJ JtXRqa5w==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT1lV-0004fH-KR; Thu, 15 Oct 2020 11:49:49 +0000 Date: Thu, 15 Oct 2020 12:49:49 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, ecryptfs@vger.kernel.org, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, Richard Weinberger , linux-xfs@vger.kernel.org Subject: Re: [PATCH v2 00/16] Allow readpage to return a locked page Message-ID: <20201015114949.GY20115@casper.infradead.org> References: <20201009143104.22673-1-willy@infradead.org> <20201015090242.GA12879@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201015090242.GA12879@infradead.org> 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 Thu, Oct 15, 2020 at 10:02:42AM +0100, Christoph Hellwig wrote: > On Fri, Oct 09, 2020 at 03:30:48PM +0100, Matthew Wilcox (Oracle) wrote: > > Ideally all filesystems would return from ->readpage with the page > > Uptodate and Locked, but it's a bit painful to convert all the > > asynchronous readpage implementations to synchronous. The first 14 > > filesystems converted are already synchronous. The last two patches > > convert iomap to synchronous readpage. > > Is it really that bad? It seems like a lot of the remainig file systems > use the generic mpage/buffer/nobh helpers. > > But I guess this series is a good first step. I'm just testing a patch to mpage_readpage(): +++ b/fs/mpage.c @@ -406,11 +406,17 @@ int mpage_readpage(struct page *page, get_block_t get_block) .nr_pages = 1, .get_block = get_block, }; + int err; args.bio = do_mpage_readpage(&args); - if (args.bio) - mpage_bio_submit(REQ_OP_READ, 0, args.bio); - return 0; + if (!args.bio) + return 0; + bio_set_op_attrs(args.bio, REQ_OP_READ, 0); + guard_bio_eod(args.bio); + err = submit_bio_wait(args.bio); + if (!err) + err = AOP_UPDATED_PAGE; + return err; } EXPORT_SYMBOL(mpage_readpage); but I'm not looking forward to block_read_full_page().