[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <76b80fff-0f62-4708-95e6-87de272f35a5@intel.com>
Date: Mon, 27 Jan 2025 12:52:51 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Mateusz Guzik <mjguzik@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Theodore Ts'o <tytso@....edu>,
Ext4 Developers List <linux-ext4@...r.kernel.org>,
Linux Kernel Developers List <linux-kernel@...r.kernel.org>,
akpm@...ux-foundation.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] ext4: use private version of page_zero_new_buffers() for
data=journal mode
On 1/26/25 14:45, Mateusz Guzik wrote:
>>
>> So if you don't get around to it, and _if_ I remember this when the
>> merge window is open, I might do it in my local tree, but then it will
>> end up being too late for this merge window.
>>
> The to-be-unreverted change was written by Dave (cc'ed).
>
> I had a brief chat with him on irc, he said he is going to submit an
> updated patch.
I poked at it a bit today. There's obviously been the page=>folio churn
and also iov_iter_fault_in_readable() got renamed and got some slightly
new semantics.
Additionally, I'm doubting the explicit pagefault_disable(). The
original patch did this:
+ pagefault_disable();
copied = iov_iter_copy_from_user_atomic(page, i, offset, bytes);
+ pagefault_enable();
and the modern generic_perform_write() is using:
copied = copy_folio_from_iter_atomic(folio, offset, bytes, i);
But the "atomic" copy is using kmap_atomic() internally which has a
built-in pagefault_disable(). It wouldn't be super atomic if it were
handling page faults of course.
So I don't think generic_perform_write() needs to do its own
pagefault_disable().
I actually still had the original decade-old test case sitting around
compiled on my test box. It still triggers the issue and _will_ livelock
if fault_in_iov_iter_readable() isn't called somewhere.
Anyway, here's a patch that compiles, boots and doesn't immediately fall
over on ext4 in case anyone else wants to poke at it. I'll do a real
changelog, SoB, etc.... and send it out for real tomorrow if it holds up.
View attachment "generic_perform_write-1.patch" of type "text/x-patch" (1692 bytes)
Powered by blists - more mailing lists