[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALF+zOm++OzAebR4wu+Hdf8Aa8GpXZu8Am9eVajVUiDMBJE63w@mail.gmail.com>
Date: Tue, 26 Jan 2021 14:10:26 -0500
From: David Wysochanski <dwysocha@...hat.com>
To: Chuck Lever <chuck.lever@...cle.com>
Cc: Matthew Wilcox <willy@...radead.org>,
David Howells <dhowells@...hat.com>,
Trond Myklebust <trondmy@...merspace.com>,
Anna Schumaker <anna.schumaker@...app.com>,
Steve French <sfrench@...ba.org>,
Dominique Martinet <asmadeus@...ewreck.org>,
Jeff Layton <jlayton@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
linux-cachefs <linux-cachefs@...hat.com>,
"linux-afs@...ts.infradead.org" <linux-afs@...ts.infradead.org>,
Linux NFS Mailing List <linux-nfs@...r.kernel.org>,
CIFS <linux-cifs@...r.kernel.org>,
"ceph-devel@...r.kernel.org" <ceph-devel@...r.kernel.org>,
"v9fs-developer@...ts.sourceforge.net"
<v9fs-developer@...ts.sourceforge.net>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 32/32] NFS: Convert readpage to readahead and use
netfs_readahead for fscache
On Tue, Jan 26, 2021 at 10:25 AM Chuck Lever <chuck.lever@...cle.com> wrote:
>
>
>
> > On Jan 25, 2021, at 8:36 PM, Matthew Wilcox <willy@...radead.org> wrote:
> >
> >
> > For Subject: s/readpage/readpages/
> >
> > On Mon, Jan 25, 2021 at 09:37:29PM +0000, David Howells wrote:
> >> +int __nfs_readahead_from_fscache(struct nfs_readdesc *desc,
> >> + struct readahead_control *rac)
> >
> > I thought you wanted it called ractl instead of rac? That's what I've
> > been using in new code.
> >
> >> - dfprintk(FSCACHE, "NFS: nfs_getpages_from_fscache (0x%p/%u/0x%p)\n",
> >> - nfs_i_fscache(inode), npages, inode);
> >> + dfprintk(FSCACHE, "NFS: nfs_readahead_from_fscache (0x%p/0x%p)\n",
> >> + nfs_i_fscache(inode), inode);
> >
> > We do have readahead_count() if this is useful information to be logging.
>
> As a sidebar, the Linux NFS community is transitioning to tracepoints.
> It would be helpful (but not completely necessary) to use tracepoints
> in new code instead of printk.
>
The netfs API has a lot of good tracepoints and to be honest I think we can
get rid of fscache's rpcdebug, but let me take a closer look to be
sure. I didn't use rpcdebug much, if at all, in the latest rounds of debugging.
>
> >> +static inline int nfs_readahead_from_fscache(struct nfs_readdesc *desc,
> >> + struct readahead_control *rac)
> >> {
> >> - if (NFS_I(inode)->fscache)
> >> - return __nfs_readpages_from_fscache(ctx, inode, mapping, pages,
> >> - nr_pages);
> >> + if (NFS_I(rac->mapping->host)->fscache)
> >> + return __nfs_readahead_from_fscache(desc, rac);
> >> return -ENOBUFS;
> >> }
> >
> > Not entirely sure that it's worth having the two functions separated any more.
> >
> >> /* attempt to read as many of the pages as possible from the cache
> >> * - this returns -ENOBUFS immediately if the cookie is negative
> >> */
> >> - ret = nfs_readpages_from_fscache(desc.ctx, inode, mapping,
> >> - pages, &nr_pages);
> >> + ret = nfs_readahead_from_fscache(&desc, rac);
> >> if (ret == 0)
> >> goto read_complete; /* all pages were read */
> >>
> >> nfs_pageio_init_read(&desc.pgio, inode, false,
> >> &nfs_async_read_completion_ops);
> >>
> >> - ret = read_cache_pages(mapping, pages, readpage_async_filler, &desc);
> >> + while ((page = readahead_page(rac))) {
> >> + ret = readpage_async_filler(&desc, page);
> >> + put_page(page);
> >> + }
> >
> > I thought with the new API we didn't need to do this kind of thing
> > any more? ie no matter whether fscache is configured in or not, it'll
> > submit the I/Os.
>
> --
> Chuck Lever
>
>
>
Powered by blists - more mailing lists