From: Dave Hansen <dave.hansen@intel.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Ted Ts'o <tytso@mit.edu>, Christian Brauner <brauner@kernel.org>,
"Darrick J. Wong" <djwong@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org,
almaz.alexandrovich@paragon-software.com, ntfs3@lists.linux.dev,
miklos@szeredi.hu, linux-bcachefs@vger.kernel.org, clm@fb.com,
josef@toxicpanda.com, dsterba@suse.com,
linux-btrfs@vger.kernel.org, dhowells@redhat.com,
jlayton@kernel.org, netfs@lists.linux.dev
Subject: Re: [PATCH 0/7] Move prefaulting into write slow paths
Date: Thu, 30 Jan 2025 17:34:18 -0800 [thread overview]
Message-ID: <562e4bdc-d0f3-4a4d-8443-174c716daaa0@intel.com> (raw)
In-Reply-To: <t7rjw6a462k5sm2tdviyd7sq6n44uxb3haai566m4hm7dvvlpi@btt3blanouck>
On 1/30/25 16:56, Kent Overstreet wrote:
> On Thu, Jan 30, 2025 at 08:04:49AM -0800, Dave Hansen wrote:...
>> Any suggestions for fully describing the situation? I tried to sprinkle
>> comments liberally but I'm also painfully aware that I'm not doing a
>> perfect job of talking about the fs code.
>
> The critical thing to cover is the fact that mmap means that page faults
> can recurse into arbitrary filesystem code, thus blowing a hole in all
> our carefully crafted lock ordering if we allow that while holding
> locks - you didn't mention that at all.
What I've got today is this:
/*
* This needs to be atomic because actually handling page
* faults on 'i' can deadlock if the copy targets a
* userspace mapping of 'folio'.
*/
copied = copy_folio_from_iter_atomic(...);
Are you saying you'd prefer that this be something more like:
/*
* Faults here on mmap()s can recurse into arbitrary
* filesystem code. Lots of locks are held that can
* deadlock. Use an atomic copy to avoid deadlocking
* in page fault handling.
*/
?
>>> I do agree on moving it to the slowpath - I think we can expect the case
>>> where the process's immediate workingset is faulted out while it's
>>> running to be vanishingly small.
>>
>> Great! I'm glad we're on the same page there.
>>
>> For bcachefs specifically, how should we move forward? If you're happy
>> with the concept, would you prefer that I do some manual bcachefs
>> testing? Or leave a branch sitting there for a week and pray the robots
>> test it?
>
> No to the sit and pray. If I see one more "testing? that's something
> other people do" conversation I'll blow another gasket.
>
> xfstests supports bcachefs, and if you need a really easy way to run it
> locally on all the various filesystems, I have a solution for that:
>
> https://evilpiepirate.org/git/ktest.git/
>
> If you want access to my CI that runs all that in parallel across 120
> VMs with the nice dashboard - shoot me an email and I'll outline server
> costs and we can work something out.
That _sounds_ a bit heavyweight to me for this patch:
b/fs/bcachefs/fs-io-buffered.c | 30 ++++++++++--------------------
1 file changed, 10 insertions(+), 20 deletions(-)
Is that the the kind of testing (120 VMs) that is needed to get a patch
into bcachefs?
Or are you saying that running xfstests on bcachefs with this patch
applied would be sufficient?
On the x86 side, I'm usually pretty happy to know that someone has
compiled a patch and at least executed the code at runtime a time or
two. So this process is a bit unfamiliar to me.
next prev parent reply other threads:[~2025-01-31 1:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-29 18:17 [PATCH 0/7] Move prefaulting into write slow paths Dave Hansen
2025-01-29 18:17 ` [PATCH 1/7] filemap: Move prefaulting out of hot write path Dave Hansen
2025-01-29 18:17 ` [PATCH 2/7] iomap: " Dave Hansen
2025-01-31 7:59 ` Christoph Hellwig
2025-01-29 18:17 ` [PATCH 3/7] ntfs3: " Dave Hansen
2025-01-29 18:17 ` [PATCH 4/7] fuse: " Dave Hansen
2025-04-15 8:43 ` Miklos Szeredi
2025-01-29 18:17 ` [PATCH 5/7] bcachefs: " Dave Hansen
2025-01-29 18:18 ` [PATCH 6/7] btrfs: " Dave Hansen
2025-01-29 18:18 ` [PATCH 7/7] netfs: Remove outdated comments about prefaulting Dave Hansen
2025-01-30 7:44 ` [PATCH 0/7] Move prefaulting into write slow paths Kent Overstreet
2025-01-30 16:04 ` Dave Hansen
2025-01-30 21:36 ` Dave Chinner
2025-01-31 1:06 ` Kent Overstreet
2025-01-31 0:56 ` Kent Overstreet
2025-01-31 1:34 ` Dave Hansen [this message]
2025-01-31 2:17 ` Kent Overstreet
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=562e4bdc-d0f3-4a4d-8443-174c716daaa0@intel.com \
--to=dave.hansen@intel.com \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=brauner@kernel.org \
--cc=clm@fb.com \
--cc=dave.hansen@linux.intel.com \
--cc=dhowells@redhat.com \
--cc=djwong@kernel.org \
--cc=dsterba@suse.com \
--cc=jlayton@kernel.org \
--cc=josef@toxicpanda.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=netfs@lists.linux.dev \
--cc=ntfs3@lists.linux.dev \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
--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