From: Dave Chinner <david@fromorbit.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: Chuck Lever III <chuck.lever@oracle.com>,
Anna Schumaker <anna@kernel.org>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v3 6/6] NFSD: Repeal and replace the READ_PLUS implementation
Date: Fri, 22 Jul 2022 09:12:16 +1000 [thread overview]
Message-ID: <20220721231216.GR3600936@dread.disaster.area> (raw)
In-Reply-To: <8122876aa3afe2b57d2c3153045d3e1936210b98.camel@kernel.org>
On Wed, Jul 20, 2022 at 08:55:23AM -0400, Jeff Layton wrote:
> On Wed, 2022-07-20 at 12:36 +1000, Dave Chinner wrote:
> > > Now how does the server make that choice? Is there an attribute
> > > bit that indicates when a file should be treated as sparse? Can
> > > we assume that immutable files (or compressed files) should
> > > always be treated as sparse? Alternately, the server might use
> > > the file's data : hole ratio.
> >
> > None of the above. The NFS server has no business knowing intimate
> > details about how the filesystem has laid out the file. All it cares
> > about ranges containing data and ranges that have no data (holes).
> >
> > If the filesystem can support a sparse read, it returns sparse
> > ranges containing data to the NFS server. If the filesystem can't
> > support it, or it's internal file layout doesn't allow for efficient
> > hole/data discrimination, then it can just return the entire read
> > range.
> >
> > Alternatively, in this latter case, the filesystem could call a
> > generic "sparse read" implementation that runs memchr_inv() to find
> > the first data range to return. Then the NFS server doesn't have to
> > code things differently, filesystems don't need to advertise
> > support for sparse reads, etc because every filesystem could
> > support sparse reads.
> >
> > The only difference is that some filesystems will be much more
> > efficient and faster at it than others. We already see that sort
> > of thing with btrfs and seek hole/data on large cached files so I
> > don't see "filesystems perform differently" as a problem here...
> >
>
> ^^^
> This seems like more trouble than it's worth, and would probably result
> in worse performance. The generic implementation should just return a
> single non-sparse extent in the sparse read reply if it doesn't know how
> to fill out a sparse read properly. IOW, we shouldn't try to find holes,
> unless the underlying filesystem can do that itself via iomap sparse
> read or some similar mechanism.
Yup, that's what I'd suggest initially, then a separate
investigation can be done to determine if manual hole detection is
worth the effort for those filesystems that cannot support sparse
reads effectively.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2022-07-21 23:12 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 18:44 [PATCH v3 0/6] NFSD: Improvements for the NFSv4.2 READ_PLUS operation Anna Schumaker
2022-07-15 18:44 ` [PATCH v3 1/6] SUNRPC: Introduce xdr_stream_move_subsegment() Anna Schumaker
2022-07-15 18:44 ` [PATCH v3 2/6] SUNRPC: Introduce xdr_encode_double() Anna Schumaker
2022-07-15 18:44 ` [PATCH v3 3/6] SUNRPC: Introduce xdr_buf_trim_head() Anna Schumaker
2022-07-15 18:44 ` [PATCH v3 4/6] SUNRPC: Introduce xdr_buf_nth_page_address() Anna Schumaker
2022-07-15 18:44 ` [PATCH v3 5/6] SUNRPC: Export xdr_buf_pagecount() Anna Schumaker
2022-07-15 18:44 ` [PATCH v3 6/6] NFSD: Repeal and replace the READ_PLUS implementation Anna Schumaker
2022-07-15 19:08 ` Chuck Lever III
2022-07-18 1:15 ` Dave Chinner
2022-07-19 17:21 ` Chuck Lever III
2022-07-19 20:24 ` Anna Schumaker
2022-07-19 20:47 ` Chuck Lever III
2022-07-19 21:10 ` Matthew Wilcox
2022-07-19 23:18 ` Dave Chinner
2022-07-19 20:46 ` Anna Schumaker
2022-07-19 22:44 ` Dave Chinner
2022-07-20 1:26 ` Chuck Lever III
2022-07-20 2:36 ` Dave Chinner
2022-07-20 4:18 ` Chuck Lever III
2022-07-22 0:44 ` Dave Chinner
2022-07-22 15:09 ` Chuck Lever III
2022-08-18 18:31 ` Anna Schumaker
2022-08-19 15:18 ` Chuck Lever III
2022-07-20 12:55 ` Jeff Layton
2022-07-21 23:12 ` Dave Chinner [this message]
2022-07-21 20:47 ` Josef Bacik
2022-07-22 12:45 ` Anna Schumaker
2022-07-22 13:32 ` Josef Bacik
2022-07-22 13:43 ` Anna Schumaker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220721231216.GR3600936@dread.disaster.area \
--to=david@fromorbit.com \
--cc=anna@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox