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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 75C9EC2D0A3 for ; Sun, 1 Nov 2020 11:52:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E6973206E5 for ; Sun, 1 Nov 2020 11:52:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6973206E5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 536CC6B005D; Sun, 1 Nov 2020 06:52:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E82D6B006C; Sun, 1 Nov 2020 06:52:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 425096B006E; Sun, 1 Nov 2020 06:52:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 18B996B005D for ; Sun, 1 Nov 2020 06:52:36 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id AA29F180AD817 for ; Sun, 1 Nov 2020 11:52:35 +0000 (UTC) X-FDA: 77435687070.08.ship58_041315a272a7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 8DD8D1819E772 for ; Sun, 1 Nov 2020 11:52:35 +0000 (UTC) X-HE-Tag: ship58_041315a272a7 X-Filterd-Recvd-Size: 5408 Received: from smtprelay.test.hostedemail.com (mail.test.hostedemail.com [216.40.41.5]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Nov 2020 11:52:35 +0000 (UTC) Received: from forelay.test.hostedemail.com (10.5.29.251.rfc1918.com [10.5.29.251]) by smtprelay01.test.hostedemail.com (Postfix) with ESMTP id CDD0911CEC for ; Sun, 1 Nov 2020 11:52:32 +0000 (UTC) Received: from forelay.prod.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by fograve01.test.hostedemail.com (Postfix) with ESMTP id 90BBC23810 for ; Sun, 1 Nov 2020 11:52:32 +0000 (UTC) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 665893628 for ; Sun, 1 Nov 2020 11:52:22 +0000 (UTC) X-FDA: 77435686524.05.air69_520c606272a7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 4B0E418016833 for ; Sun, 1 Nov 2020 11:52:22 +0000 (UTC) X-HE-Tag: air69_520c606272a7 X-Filterd-Recvd-Size: 3232 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Nov 2020 11:52:21 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 8547468B02; Sun, 1 Nov 2020 12:52:18 +0100 (CET) Date: Sun, 1 Nov 2020 12:52:17 +0100 From: Christoph Hellwig To: Matthew Wilcox Cc: Christoph Hellwig , Andrew Morton , Kent Overstreet , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 04/13] mm: handle readahead in generic_file_buffered_read_pagenotuptodate Message-ID: <20201101115217.GA27488@lst.de> References: <20201031090004.452516-1-hch@lst.de> <20201031090004.452516-5-hch@lst.de> <20201031170646.GT27442@casper.infradead.org> <20201101103144.GC26447@lst.de> <20201101104958.GU27442@casper.infradead.org> <20201101105112.GA26860@lst.de> <20201101105158.GA26874@lst.de> <20201101110406.GV27442@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201101110406.GV27442@casper.infradead.org> User-Agent: Mutt/1.5.17 (2007-11-01) 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 Sun, Nov 01, 2020 at 11:04:06AM +0000, Matthew Wilcox wrote: > > I'll stop for now. > > http://git.infradead.org/users/willy/pagecache.git/shortlog/refs/heads/next > > is what i currently have. Haven't pulled in everything from you; certainly not renaming generic_file_buffered_read to filemap_read(), which is awesome. > i'm about 500 seconds into an xfstests run. A bunch of comments from a very quick look: mm/filemap: Rename generic_file_buffered_read subfunctions - the commit log still mentions the old names mm/filemap: Change calling convention for buffered read functions - please also drop the mapping argument to the various functions while you're at it mm/filemap: Reduce indentation in gfbr_read_page - still mentionds the old function name mm/filemap: Support readpage splitting a page - nitpick, I find this a little hard to read: + } else if (!trylock_page(page)) { + put_and_wait_on_page_locked(page, TASK_KILLABLE); + return NULL; } and would write this a little more coarse as: } else { if (!trylock_page(page)) { put_and_wait_on_page_locked(page, TASK_KILLABLE); return NULL; } } Also I think the messy list of uptodate checks could now be simplified down to: if (!PageUptodate(page)) { if (inode->i_blkbits <= PAGE_SHIFT && mapping->a_ops->is_partially_uptodate && !iov_iter_is_pipe(iter)) { if (!page->mapping) goto truncated; if (mapping->a_ops->is_partially_uptodate(page, pos & (thp_size(page) - 1), count)) goto uptodate; } return filemap_read_page(iocb, mapping, page); } mm/filemap: Convert filemap_read_page to return an errno: - using a goto label for the put_page + return error case like in my patch would be cleaner I think mm/filemap: Restructure filemap_get_pages - I have to say I still like my little helper here for the two mapping_get_read_thps calls plus page_cache_sync_readahead