Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1167482ybv; Thu, 20 Feb 2020 14:39:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyazn1Ng1EjZfmrnv83fs93GOTnx10is/oVsvmDYB9iNaltS3i96Rj6sr0jpfBl+WnZfV9p X-Received: by 2002:aca:f487:: with SMTP id s129mr3875142oih.75.1582238370855; Thu, 20 Feb 2020 14:39:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582238370; cv=none; d=google.com; s=arc-20160816; b=oFDQcevzqFrO94jdAU13qh1/HSotMhslXxTpa8t2mvt9EgNbhx3nxPp+QXE0OS1gaf IKkby340f5xfEgBQoSK2X6CG0NdsGVZZg1ljHLsQHLPDZ5/voAtCl1FBoifcbTvpOePG BafG+ogm77owD1LcvglJsGhefA5/bBf4pQ5ZWWYGP1H3LYTjonasRI8/Wt+IKX4s1Q+9 bln/TbwDmm6NMKFvS2WLOVmfiFtMNwCKlgLmCpgZ1iXVsLkb0FbjtVfaRU4dXEZnpetC Qz6y3yfohVARY1pJZNatylB0HR8WESgD8jX1mm/Pcu7FbivHk8/PPPmhRL2ZAEdTnusU FMWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=PJX15g/idnsbi9mBK4m/qgB4NAR6fjeo4oenehrzb84=; b=xWpxBI0vP5nP7ITD3cW7ZYGX1XkDzjvMRZgc29Tub4ao+YQlYkT2Rt+lI6jEKckgil JTTnDID1O85nC7MX9LyXgy7Y9sAKKy+3L2p1gZho8Lwgw5DsX9x9dRn9WUcEP3MB6iT3 etuhUZII6SeVZvRdqIvEzFUevj3X1Szez1Dw7RQDbCMn2p8CehDjolLlz/4J03okOXA/ /ckNlk3oFQ/1Akp0jg3RyRla/7VKWSXPoyK7INoJXFtYT6sMOtGjiyswv/UDF3+exckL /CMN6Kwmerj6FxGVxqOCPJAhNTSMaCAPgn6Um0lkhhDQSg2aNDT41RGLJ+c+6VFyW4Ws 4Jiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="tRp/RfyO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6si444654otk.276.2020.02.20.14.39.18; Thu, 20 Feb 2020 14:39:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="tRp/RfyO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729283AbgBTWjK (ORCPT + 99 others); Thu, 20 Feb 2020 17:39:10 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:49450 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728992AbgBTWjK (ORCPT ); Thu, 20 Feb 2020 17:39:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PJX15g/idnsbi9mBK4m/qgB4NAR6fjeo4oenehrzb84=; b=tRp/RfyOc8MMAOEnFbjVZPeWaN 2KkzEKXiN/S1p09Bqu90S2Z278xQaeJcCcxdgeXrdpytnUBFOLEh/tcVUgBOZ3WDQA1fyr25gzLyH gRM7sCok3nV4KM0JhdGQW17PpL0/Q+08nFcey+vxgYObaAojcT6v9r7vvwC4L45gbM+E1ObajSRbu 9fqhh3Le7FzPdJj54Iv5P1uuGStaEN80lg311yLhBq1nMBvGvQ80nBsaseT/97o8elxjyPsMZtK46 3NBlICNdJTCPRvVzyFRBHETaOyBq9s1mCrpI3p5mh7mcYzLn6aixyJdO3+xKTmslXOd/sUkUMeqtP kTySNnYQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4uTN-0006hx-9M; Thu, 20 Feb 2020 22:39:09 +0000 Date: Thu, 20 Feb 2020 14:39:09 -0800 From: Matthew Wilcox To: dsterba@suse.cz, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, ocfs2-devel@oss.oracle.com, linux-xfs@vger.kernel.org Subject: Re: [PATCH v7 00/23] Change readahead API Message-ID: <20200220223909.GB24185@bombadil.infradead.org> References: <20200219210103.32400-1-willy@infradead.org> <20200220175400.GB2902@twin.jikos.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200220175400.GB2902@twin.jikos.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 20, 2020 at 06:54:00PM +0100, David Sterba wrote: > On Wed, Feb 19, 2020 at 01:00:39PM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > This series adds a readahead address_space operation to eventually > > replace the readpages operation. The key difference is that > > pages are added to the page cache as they are allocated (and > > then looked up by the filesystem) instead of passing them on a > > list to the readpages operation and having the filesystem add > > them to the page cache. It's a net reduction in code for each > > implementation, more efficient than walking a list, and solves > > the direct-write vs buffered-read problem reported by yu kuai at > > https://lore.kernel.org/linux-fsdevel/20200116063601.39201-1-yukuai3@huawei.com/ > > > > The only unconverted filesystems are those which use fscache. > > Their conversion is pending Dave Howells' rewrite which will make the > > conversion substantially easier. > > > > I want to thank the reviewers; Dave Chinner, John Hubbard and Christoph > > Hellwig have done a marvellous job of providing constructive criticism. > > Eric Biggers pointed out how I'd broken ext4 (which led to a substantial > > change). I've tried to take it all on board, but I may have missed > > something simply because you've done such a thorough job. > > > > This series can also be found at > > http://git.infradead.org/users/willy/linux-dax.git/shortlog/refs/tags/readahead_v7 > > (I also pushed the readahead_v6 tag there in case anyone wants to diff, and > > they're both based on 5.6-rc2 so they're easy to diff) > > > > v7: > > - Now passes an xfstests run on ext4! > > On btrfs it still chokes on the first test btrfs/001, with the following > warning, the test is stuck there. Thanks. The warning actually wasn't the problem, but it did need to be addressed. I got a test system up & running with btrfs, and it's currently on generic/027 with the following patch: diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 9c782c15f7f7..d23a224d2ad2 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -676,7 +676,7 @@ static inline unsigned int __readahead_batch(struct readahead_control *rac, struct page **array, unsigned int array_sz) { unsigned int i = 0; - XA_STATE(xas, &rac->mapping->i_pages, rac->_index); + XA_STATE(xas, &rac->mapping->i_pages, 0); struct page *page; BUG_ON(rac->_batch_count > rac->_nr_pages); @@ -684,6 +684,8 @@ static inline unsigned int __readahead_batch(struct readahead_control *rac, rac->_index += rac->_batch_count; rac->_batch_count = 0; + xas_set(&xas, rac->_index); + rcu_read_lock(); xas_for_each(&xas, page, rac->_index + rac->_nr_pages - 1) { VM_BUG_ON_PAGE(!PageLocked(page), page); VM_BUG_ON_PAGE(PageTail(page), page); @@ -702,6 +704,7 @@ static inline unsigned int __readahead_batch(struct readahead_control *rac, if (i == array_sz) break; } + rcu_read_unlock(); return i; }