mbox series

[0/3] Add a mount option to support eager writes

Message ID 20210212214949.4408-1-trondmy@kernel.org (mailing list archive)
Headers show
Series Add a mount option to support eager writes | expand

Message

Trond Myklebust Feb. 12, 2021, 9:49 p.m. UTC
From: Trond Myklebust <trond.myklebust@hammerspace.com>

The following patch series sets up a new mount option
'writes=lazy/eager/wait'. The mount option basically controls how the
write() system call works.
- writes=lazy is the default, and keeps the current behaviour
- writes=eager means we send off the write immediately as an unstable
  write to the server.
- writes=wait means we send off the write as an unstable write, and then
  wait for the reply.

The main motivator for this behaviour is that some applications expect
write() to return ENOSPC. Setting writes=wait should satisfy those
applications without taking the full overhead of a synchronous write.

writes=eager, on the other hand, can be useful for applications such as
re-exporting NFS, since it would allow knfsd on the proxying server to
immediately forward the writes to the original server.

Trond Myklebust (3):
  NFS: 'flags' field should be unsigned in struct nfs_server
  NFS: Add support for eager writes
  NFS: Add mount options supporting eager writes

 fs/nfs/file.c             | 19 +++++++++++++++++--
 fs/nfs/fs_context.c       | 33 +++++++++++++++++++++++++++++++++
 fs/nfs/write.c            | 17 ++++++++++++-----
 include/linux/nfs_fs_sb.h |  4 +++-
 4 files changed, 65 insertions(+), 8 deletions(-)

Comments

Steve Dickson Feb. 13, 2021, 2:19 p.m. UTC | #1
Hey!

On 2/12/21 4:49 PM, trondmy@kernel.org wrote:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> The following patch series sets up a new mount option
> 'writes=lazy/eager/wait'. The mount option basically controls how the
> write() system call works.
> - writes=lazy is the default, and keeps the current behaviour
> - writes=eager means we send off the write immediately as an unstable
>   write to the server.
> - writes=wait means we send off the write as an unstable write, and then
>   wait for the reply.
> 
> The main motivator for this behaviour is that some applications expect
> write() to return ENOSPC. Setting writes=wait should satisfy those
> applications without taking the full overhead of a synchronous write.
> 
> writes=eager, on the other hand, can be useful for applications such as
> re-exporting NFS, since it would allow knfsd on the proxying server to
> immediately forward the writes to the original server.
> 
> Trond Myklebust (3):
>   NFS: 'flags' field should be unsigned in struct nfs_server
>   NFS: Add support for eager writes
>   NFS: Add mount options supporting eager writes
> 
>  fs/nfs/file.c             | 19 +++++++++++++++++--
>  fs/nfs/fs_context.c       | 33 +++++++++++++++++++++++++++++++++
>  fs/nfs/write.c            | 17 ++++++++++++-----
>  include/linux/nfs_fs_sb.h |  4 +++-
>  4 files changed, 65 insertions(+), 8 deletions(-)
> 
Shouldn't something be added to the nfs(5) man page 
as well as blurb added to /etc/nfsmount.conf file?

steved.
Trond Myklebust Feb. 13, 2021, 2:20 p.m. UTC | #2
On Sat, 2021-02-13 at 09:19 -0500, Steve Dickson wrote:
> Hey!
> 
> On 2/12/21 4:49 PM, trondmy@kernel.org wrote:
> > From: Trond Myklebust <trond.myklebust@hammerspace.com>
> > 
> > The following patch series sets up a new mount option
> > 'writes=lazy/eager/wait'. The mount option basically controls how
> > the
> > write() system call works.
> > - writes=lazy is the default, and keeps the current behaviour
> > - writes=eager means we send off the write immediately as an
> > unstable
> >   write to the server.
> > - writes=wait means we send off the write as an unstable write, and
> > then
> >   wait for the reply.
> > 
> > The main motivator for this behaviour is that some applications
> > expect
> > write() to return ENOSPC. Setting writes=wait should satisfy those
> > applications without taking the full overhead of a synchronous
> > write.
> > 
> > writes=eager, on the other hand, can be useful for applications
> > such as
> > re-exporting NFS, since it would allow knfsd on the proxying server
> > to
> > immediately forward the writes to the original server.
> > 
> > Trond Myklebust (3):
> >   NFS: 'flags' field should be unsigned in struct nfs_server
> >   NFS: Add support for eager writes
> >   NFS: Add mount options supporting eager writes
> > 
> >  fs/nfs/file.c             | 19 +++++++++++++++++--
> >  fs/nfs/fs_context.c       | 33 +++++++++++++++++++++++++++++++++
> >  fs/nfs/write.c            | 17 ++++++++++++-----
> >  include/linux/nfs_fs_sb.h |  4 +++-
> >  4 files changed, 65 insertions(+), 8 deletions(-)
> > 
> Shouldn't something be added to the nfs(5) man page 
> as well as blurb added to /etc/nfsmount.conf file?
> 

Sure, but I'd like comments/consensus on the kernel bits first.