* Inquiry about ext4 atomic write
@ 2025-02-05 12:43 磊李
0 siblings, 0 replies; 2+ messages in thread
From: 磊李 @ 2025-02-05 12:43 UTC (permalink / raw)
To: Ritesh Harjani; +Cc: linux-ext4@vger.kernel.org
Hi Harjani,
I tend to enable ext4 16kb atomic write on my X86 machine, and read your RFC.
https://lwn.net/ml/linux-kernel/cover.1709356594.git.ritesh.list@gmail.com/
From the cover patch, it seems that this feature will be successfully enabled
if I enable bigalloc on ext4, and the underlying device also supports
16kb write union.
However, after checking statx results, I found that
atomic_write_unit_max was always 4096.
This snippet below limits s_awu_max to 4096(bs) which is the max value
on my platform.
```
static void ext4_atomic_write_init(struct super_block *sb)
{
...
sbi->s_awu_min = max(sb->s_blocksize,
bdev_atomic_write_unit_min_bytes(bdev));
sbi->s_awu_max = min(sb->s_blocksize,
bdev_atomic_write_unit_max_bytes(bdev));
...
}
```
I am wondering if I missed something? Or if there are any other ways
that I could enable 16kb
atomic write on my platform?
Thanks!
Li Lei
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Inquiry about ext4 atomic write
[not found] <CAPbN7U6jP=J7Yb7aSsX-oObYeM1P39T0NERRsZ_fWUb_tc6v8w@mail.gmail.com>
@ 2025-02-05 17:56 ` Ritesh Harjani
0 siblings, 0 replies; 2+ messages in thread
From: Ritesh Harjani @ 2025-02-05 17:56 UTC (permalink / raw)
To: lilei.777@bytedance.com; +Cc: linux-ext4@vger.kernel.org
"lilei.777@bytedance.com" <lilei.777@bytedance.com> writes:
> Hi Harjani,
>
> I tend to enable ext4 16kb atomic write on my X86 machine, and read your
> RFC.
> https://lwn.net/ml/linux-kernel/cover.1709356594.git.ritesh.list@gmail.com/
Hi Lei,
This is the final version which got merged [1]
[1]: https://lore.kernel.org/all/cover.1730437365.git.ritesh.list@gmail.com/
On x86, we don't have bs > ps feature. And as of today iomap restricts
the atomic write to a single filesystem block. Hence for systems with 4k
pagesize, we can't have atomic write request of size 16k on a 4k
blocksize ext4. But on arm64 or powerpc (with 64k ps) we should be
able to enable this with 16k bs, because ext4 can work with bs < ps.
>
> From the cover patch, it's seems that this feature will be successfully
> enabled
> if I enable bigalloc on ext4, and underlying device also supports 16kb
> write union.
Yes, there are still ongoing discussions around this in the community
[1][2].
[1]: https://lore.kernel.org/all/Z5nTaQgLGdD6hSvL@li-dc0c254c-257c-11b2-a85c-98b6c1322444.ibm.com/
[2]: https://lore.kernel.org/linux-xfs/20241204154344.3034362-1-john.g.garry@oracle.com/
-ritesh
> However, after checking xstat result, i found atomic_write_unit_max was
> always 4096.
>
> This snippet below limits s_awu_max to 4096(bs) which is the max value on
> my platform.
>
> ```
> static void ext4_atomic_write_init(struct super_block *sb)
> {
> ...
> sbi->s_awu_min = max(sb->s_blocksize,
> bdev_atomic_write_unit_min_bytes(bdev));
> sbi->s_awu_max = min(sb->s_blocksize,
> bdev_atomic_write_unit_max_bytes(bdev));
> ...
> }
> ```
>
> I am wondering if I missed someting? Or if there any other ways could
> enable 16kb
> atomic write on my platform?
>
> Thanks!
> Li Lei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-05 18:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAPbN7U6jP=J7Yb7aSsX-oObYeM1P39T0NERRsZ_fWUb_tc6v8w@mail.gmail.com>
2025-02-05 17:56 ` Inquiry about ext4 atomic write Ritesh Harjani
2025-02-05 12:43 磊李
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.