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=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 64D1CC33CAE for ; Mon, 13 Jan 2020 18:22:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3513F214AF for ; Mon, 13 Jan 2020 18:22:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3513F214AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C64828E0005; Mon, 13 Jan 2020 13:22:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C14458E0003; Mon, 13 Jan 2020 13:22:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B03448E0005; Mon, 13 Jan 2020 13:22:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id 9779E8E0003 for ; Mon, 13 Jan 2020 13:22:45 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 5325B3A92 for ; Mon, 13 Jan 2020 18:22:45 +0000 (UTC) X-FDA: 76373431890.25.turn43_6f4fba264b01b X-HE-Tag: turn43_6f4fba264b01b X-Filterd-Recvd-Size: 4027 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Mon, 13 Jan 2020 18:22:44 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 30EE2AFCB; Mon, 13 Jan 2020 18:22:43 +0000 (UTC) Date: Mon, 13 Jan 2020 19:22:42 +0100 From: Daniel Wagner To: Matthew Wilcox Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, jlayton@kernel.org, hch@infradead.org Subject: Re: [PATCH 4/8] mm/fs: Add a_ops->readahead Message-ID: <20200113182242.byzbv5frzyymbddi@beryllium.lan> References: <20200113153746.26654-1-willy@infradead.org> <20200113153746.26654-5-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200113153746.26654-5-willy@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: Hi, On Mon, Jan 13, 2020 at 07:37:42AM -0800, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > This will replace ->readpages with a saner interface: > - No return type (errors are ignored for read ahead anyway) > - Pages are already in the page cache when ->readpages is called > - Pages are passed in a pagevec instead of a linked list > > Signed-off-by: Matthew Wilcox (Oracle) > --- > Documentation/filesystems/locking.rst | 8 +++++- > Documentation/filesystems/vfs.rst | 9 ++++++ > include/linux/fs.h | 3 ++ > mm/readahead.c | 40 ++++++++++++++++++++++++++- > 4 files changed, 58 insertions(+), 2 deletions(-) > > diff --git a/Documentation/filesystems/locking.rst b/Documentation/filesystems/locking.rst > index 5057e4d9dcd1..1e2f1186fd1a 100644 > --- a/Documentation/filesystems/locking.rst > +++ b/Documentation/filesystems/locking.rst > @@ -239,6 +239,8 @@ prototypes:: > int (*readpage)(struct file *, struct page *); > int (*writepages)(struct address_space *, struct writeback_control *); > int (*set_page_dirty)(struct page *page); > + int (*readahead)(struct file *, struct address_space *, > + struct pagevec *, pgoff_t index); Shouldn't this be no return type? Just trying to map your commit message to the code. > int (*readpages)(struct file *filp, struct address_space *mapping, > struct list_head *pages, unsigned nr_pages); > int (*write_begin)(struct file *, struct address_space *mapping, > @@ -271,7 +273,8 @@ writepage: yes, unlocks (see below) > readpage: yes, unlocks > writepages: > set_page_dirty no > -readpages: > +readpages: no > +readahead: yes, unlocks > write_begin: locks the page exclusive > write_end: yes, unlocks exclusive > bmap: > @@ -298,6 +301,9 @@ completion. > ->readpages() populates the pagecache with the passed pages and starts > I/O against them. They come unlocked upon I/O completion. > > +->readahead() starts I/O against the pages. They come unlocked upon > +I/O completion. > + > ->writepage() is used for two purposes: for "memory cleansing" and for > "sync". These are quite different operations and the behaviour may differ > depending upon the mode. > diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst > index 7d4d09dd5e6d..63d0f0dbbf9c 100644 > --- a/Documentation/filesystems/vfs.rst > +++ b/Documentation/filesystems/vfs.rst > @@ -706,6 +706,8 @@ cache in your filesystem. The following members are defined: > int (*readpage)(struct file *, struct page *); > int (*writepages)(struct address_space *, struct writeback_control *); > int (*set_page_dirty)(struct page *page); > + int (*readahead)(struct file *, struct address_space *, > + struct pagevec *, pgoff_t index); Same here? Maybe I just miss the point, in the case, sorry for the noise. Thanks, Daniel