linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Why doesn't FUSE use stable writes?
Date: Sat, 16 Dec 2023 10:33:50 +0100	[thread overview]
Message-ID: <CAJfpegvgTG3KvbLKX75twenOSxBEk2RjMyA1o9krOedm_zZWqg@mail.gmail.com> (raw)
In-Reply-To: <ZXz39r4SR39DmPcW@casper.infradead.org>

On Sat, 16 Dec 2023 at 02:06, Matthew Wilcox <willy@infradead.org> wrote:
>
>
> I'm looking at fuse_writepage_locked() and it allocates a new page, then
> copies from the page cache into that page before sending that page to
> userspace.  I imagine you want to prevent torn writes, so why not set
> SB_I_STABLE_WRITES instead of having this memcpy?

It's not as simple as that.  Fuse wants to do its writes independently
of the mm's reclaim mechanisms so that it doesn't get into the sort of
deadlock that PF_MEMALLOC is supposed to prevent inside the kernel.  I
don't remember the details, but the last time I looked this issue
(which wasn't recently) there was no feasible alternative to copying
the page.

Thanks,
Miklos

      reply	other threads:[~2023-12-16  9:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-16  1:05 Why doesn't FUSE use stable writes? Matthew Wilcox
2023-12-16  9:33 ` Miklos Szeredi [this message]

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=CAJfpegvgTG3KvbLKX75twenOSxBEk2RjMyA1o9krOedm_zZWqg@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).