All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Trond Myklebust <trondmy@hammerspace.com>,
	"dan.aloni@vastdata.com" <dan.aloni@vastdata.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] nfs: add 'noextend' option for lock-less 'lost writes' prevention
Date: Wed, 19 Jun 2024 11:37:52 +0300	[thread overview]
Message-ID: <ae298053-bdee-4a8a-b6a9-e57de79abc97@grimberg.me> (raw)
In-Reply-To: <d2f48ca233f85da80f2193cd92e6f97feb587a69.camel@hammerspace.com>



On 18/06/2024 21:59, Trond Myklebust wrote:
> Hi Dan,
>
> On Tue, 2024-06-18 at 18:33 +0300, Dan Aloni wrote:
>> There are some applications that write to predefined non-overlapping
>> file offsets from multiple clients and therefore don't need to rely
>> on
>> file locking. However, NFS file system behavior of extending writes
>> to
>> to deal with write fragmentation, causes those clients to corrupt
>> each
>> other's data.
>>
>> To help these applications, this change adds the `noextend` parameter
>> to
>> the mount options, and handles this case in `nfs_can_extend_write`.
>>
>> Clients can additionally add the 'noac' option to ensure page cache
>> flush on read for modified files.
> I'm not overly enamoured of the name "noextend". To me that sounds like
> it might have something to do with preventing appends. Can we find
> something that is a bit more descriptive?

nopbw (No page boundary writes) ?

>
> That said, and given your last comment about reads. Wouldn't it be
> better to have the application use O_DIRECT for these workloads?
> Turning off attribute caching is both racy and an inefficient way to
> manage page cache consistency. It forces the client to bombard the
> server with GETATTR requests in order to check that the page cache is
> in synch, whereas your description of the workload appears to suggest
> that the correct assumption should be that it is not in synch.
>
> IOW: I'm asking if the better solution might not be to rather implement
> something akin to Solaris' "forcedirectio"?

This access pattern represents a common case in HPC where different workers
write records to a shared output file which do not necessarily align to 
a page boundary.

This is not everything that the app is doing nor the only file it is 
accessing, so IMO forcing
directio universally is may penalize the application.

  reply	other threads:[~2024-06-19  8:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 15:33 [PATCH] nfs: add 'noextend' option for lock-less 'lost writes' prevention Dan Aloni
2024-06-18 18:59 ` Trond Myklebust
2024-06-19  8:37   ` Sagi Grimberg [this message]
2024-06-19 14:15     ` Trond Myklebust
2024-06-19 14:31       ` Sagi Grimberg
2024-06-20  5:27         ` Christoph Hellwig
2024-06-20  6:41           ` Sagi Grimberg
2024-06-20  5:26       ` Christoph Hellwig
2024-06-19  5:44 ` Christoph Hellwig
2024-06-19 13:33   ` Trond Myklebust
2024-06-19 18:03     ` Trond Myklebust
2024-06-20  5:13       ` hch

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=ae298053-bdee-4a8a-b6a9-e57de79abc97@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=dan.aloni@vastdata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@hammerspace.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.