All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: "lilei.777@bytedance.com" <lilei.777@bytedance.com>
Cc: "linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: Inquiry about ext4 atomic write
Date: Wed, 05 Feb 2025 23:26:05 +0530	[thread overview]
Message-ID: <87cyfws2bu.fsf@gmail.com> (raw)
In-Reply-To: <CAPbN7U6jP=J7Yb7aSsX-oObYeM1P39T0NERRsZ_fWUb_tc6v8w@mail.gmail.com>

"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

       reply	other threads:[~2025-02-05 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAPbN7U6jP=J7Yb7aSsX-oObYeM1P39T0NERRsZ_fWUb_tc6v8w@mail.gmail.com>
2025-02-05 17:56 ` Ritesh Harjani [this message]
2025-02-05 12:43 Inquiry about ext4 atomic write 磊李

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=87cyfws2bu.fsf@gmail.com \
    --to=ritesh.list@gmail.com \
    --cc=lilei.777@bytedance.com \
    --cc=linux-ext4@vger.kernel.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 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.