From: Jeff Layton <jlayton@kernel.org>
To: Anna Schumaker <anna.schumaker@oracle.com>,
lsf-pc@lists.linux-foundation.org
Cc: linux-fsdevel@vger.kernel.org,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [LSF/MM/BPF TOPIC] Implementing the NFS v4.2 WRITE_SAME operation: VFS or NFS ioctl() ?
Date: Wed, 15 Jan 2025 09:24:21 -0500 [thread overview]
Message-ID: <0116f16a917aa56fa9350f801c48d4edc81ce70f.camel@kernel.org> (raw)
In-Reply-To: <f9ade3f0-6bfc-45da-a796-c22ceaeb4722@oracle.com>
On Tue, 2025-01-14 at 16:38 -0500, Anna Schumaker wrote:
> I've seen a few requests for implementing the NFS v4.2 WRITE_SAME [1] operation over the last few months [2][3] to accelerate writing patterns of data on the server, so it's been in the back of my mind for a future project. I'll need to write some code somewhere so NFS & NFSD can handle this request. I could keep any implementation internal to NFS / NFSD, but I'd like to find out if local filesystems would find this sort of feature useful and if I should put it in the VFS instead.
>
> I was thinking I could keep it simple, and model a function call based on write(3) / pwrite(3) to write some pattern N times starting at either the file's current offset or at a user-provide offset. Something like:
> write_pattern(int filedes, const void *pattern, size_t nbytes, size_t count);
> pwrite_pattern(int filedes, const void *pattern, size_t nbytes, size_t count, offset_t offset);
>
These should also get flags fields, for sure.
> I could then construct a WRITE_SAME call in the NFS client using this information. This seems "good enough" to me for what people have asked for, at least as a client-side interface. It wouldn't really help the server, which would still need to do several writes in a loop to be spec-compliant with writing the pattern to an offset inside the "application data block" [4] structure.
>
> But maybe I'm simplifying this too much, and others would find the additional application data block fields useful? Or should I keep it all inside NFS, and call it with an ioctl instead of putting it into the VFS?
>
> Thoughts?
> Anna
>
> [1]: https://datatracker.ietf.org/doc/html/rfc7862#section-15.12
> [2]: https://lore.kernel.org/linux-nfs/CAAvCNcByQhbxh9aq_z7GfHx+_=S8zVcr9-04zzdRVLpLbhxxSg@mail.gmail.com/
> [3]: https://lore.kernel.org/linux-nfs/CALWcw=Gg33HWRLCrj9QLXMPME=pnuZx_tE4+Pw8gwutQM4M=vw@mail.gmail.com/
> [4]: https://datatracker.ietf.org/doc/html/rfc7862#section-8.1
>
I'd say keep it as an ioctl for now until we have at least one other
filesystem (smb/client? fs/ceph?) that can implement this natively
somehow.
My worry here is that we would build these new syscalls, and then find
that other filesystems need subtly different semantics for this, and
then we have to scramble to shoehorn those in later.
Are there are already other existing ioctls on other filesystems for
similar operations?
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2025-01-15 14:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 21:38 [LSF/MM/BPF TOPIC] Implementing the NFS v4.2 WRITE_SAME operation: VFS or NFS ioctl() ? Anna Schumaker
2025-01-14 23:14 ` Dave Chinner
2025-01-16 5:42 ` Christoph Hellwig
2025-01-16 13:37 ` Theodore Ts'o
2025-01-16 13:59 ` Chuck Lever
2025-01-16 15:36 ` Theodore Ts'o
2025-01-16 15:45 ` Chuck Lever
2025-01-16 17:30 ` Theodore Ts'o
2025-01-16 22:11 ` [Lsf-pc] " Martin K. Petersen
2025-01-16 21:54 ` Martin K. Petersen
2025-01-15 2:10 ` Darrick J. Wong
2025-01-15 12:30 ` Roland Mainz
2025-01-15 14:24 ` Jeff Layton [this message]
2025-01-15 15:06 ` Matthew Wilcox
2025-01-15 15:31 ` Chuck Lever
2025-01-15 16:19 ` Matthew Wilcox
2025-01-15 18:20 ` Darrick J. Wong
2025-01-15 18:43 ` Chuck Lever
2025-01-16 5:40 ` Christoph Hellwig
2026-02-23 20:25 ` Dan Shelton
2026-02-23 20:39 ` [External] : " 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=0116f16a917aa56fa9350f801c48d4edc81ce70f.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=anna.schumaker@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=lsf-pc@lists.linux-foundation.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