* Re: LBS support for EXT4
2025-06-20 15:55 ` LBS support for EXT4 Jan Kara
@ 2025-06-21 0:25 ` Baokun Li
2025-06-21 2:54 ` Zhang Yi
2025-06-23 13:14 ` Pankaj Raghav
2 siblings, 0 replies; 10+ messages in thread
From: Baokun Li @ 2025-06-21 0:25 UTC (permalink / raw)
To: Pankaj Raghav
Cc: Jan Kara, tytso, Luis Chamberlain, Pankaj Raghav, linux-ext4,
Zhang Yi, Baokun Li
Hi Pankaj Raghav,
We have some local patches that enable LBS (Logical Block Size) support in
ext4. Previously, we held off on releasing them because of an issue with
bdev LBS support in migration scenarios, and Zhang Yi's folio-related
patches hadn't been merged yet.
Now that both of these prerequisites are met, I will rebase and send out
this patch series as soon as possible.
Regards,
Baokun
On 2025/6/20 23:55, Jan Kara wrote:
> [added ext4 list and Zhang to CC]
>
> Hi,
>
> On Thu 19-06-25 15:05:14, Pankaj Raghav wrote:
>> Hello Jan and Ted,
>>
>> As you might know, I added LBS support to XFS sometime back. And after
>> that Luis added LBS support to block devices/buffer head path.
>>
>> And now that EXT4 supports large folios, it should be possible to add LBS
>> support to EXT4.
>>
>> I started digging in to the code, and it looks like it might require some
>> rework throughout EXT4 and lot of testing.
>>
>> My question is:
>>
>> I have seen patches from Zhang Yi to add iomap buffered IO support to EXT4.
>> If that happens, then adding LBS support should become trivial.
>>
>> Do you think it might happen soon or it is going to take more time?
>> Seeing the patches it is hard for me to say what the status is as the
>> last patches posted for them was last year.
> Well, time is always relative so it's difficult to tell what do you mean by
> "soon" :). We are definitely interested in converting ext4 to iomap.
> Currently we are fixing up some remaining issues caused by conversion to
> support large order folios but after that iomap conversion would be a next
> logical step. Zhang Yi had patches for that, I'm not sure how much from
> them is left to apply after the large order folios have landed.
>
>> The reason I am asking is, should I take up the challenge to add LBS
>> support with buffer heads in EXT4, or should I wait until iomap patches
>> are merged.
> I think better spent time would be to help with the iomap conversion. I
> don't think there will be that much coding left (perhaps some more exotic
> features need attention) but there's definitely testing needed and review
> is always welcome and most needed...
>
> Honza
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LBS support for EXT4
2025-06-20 15:55 ` LBS support for EXT4 Jan Kara
2025-06-21 0:25 ` Baokun Li
@ 2025-06-21 2:54 ` Zhang Yi
2025-06-23 13:22 ` Pankaj Raghav
2025-06-23 13:14 ` Pankaj Raghav
2 siblings, 1 reply; 10+ messages in thread
From: Zhang Yi @ 2025-06-21 2:54 UTC (permalink / raw)
To: Jan Kara, Pankaj Raghav
Cc: tytso, Luis Chamberlain, Pankaj Raghav, linux-ext4
Hi Pankaj and Jan,
On 2025/6/20 23:55, Jan Kara wrote:
> [added ext4 list and Zhang to CC]
>
> Hi,
>
> On Thu 19-06-25 15:05:14, Pankaj Raghav wrote:
>> Hello Jan and Ted,
>>
>> As you might know, I added LBS support to XFS sometime back. And after
>> that Luis added LBS support to block devices/buffer head path.
>>
>> And now that EXT4 supports large folios, it should be possible to add LBS
>> support to EXT4.
>>
>> I started digging in to the code, and it looks like it might require some
>> rework throughout EXT4 and lot of testing.
>>
>> My question is:
>>
>> I have seen patches from Zhang Yi to add iomap buffered IO support to EXT4.
>> If that happens, then adding LBS support should become trivial.
>>
>> Do you think it might happen soon or it is going to take more time?
>> Seeing the patches it is hard for me to say what the status is as the
>> last patches posted for them was last year.
>
> Well, time is always relative so it's difficult to tell what do you mean by
> "soon" :). We are definitely interested in converting ext4 to iomap.
> Currently we are fixing up some remaining issues caused by conversion to
> support large order folios but after that iomap conversion would be a next
> logical step. Zhang Yi had patches for that, I'm not sure how much from
> them is left to apply after the large order folios have landed.
We have been working on the conversion of ext4 to iomap. The conversion
process for iomap has proven to be more complex than anticipated due to
numerous prerequisite issues and necessary refactors that must be
integrated. Currently, all prerequisite patches(perhaps) have been merged
into the latest 6.16-rc1 release, so I am rebasing my iomap series recently.
However, I have encountered some blocking issues during the rebase, and
I am trying to resolve them. I hope to release it as soon as possible.
>
>> The reason I am asking is, should I take up the challenge to add LBS
>> support with buffer heads in EXT4, or should I wait until iomap patches
>> are merged.
>
> I think better spent time would be to help with the iomap conversion. I
> don't think there will be that much coding left (perhaps some more exotic
> features need attention) but there's definitely testing needed and review
> is always welcome and most needed...
>
My colleagues, Baokun and Zhihao, have been working on LBS support for a
couple of months, based on my two large folio series (buffer_head and
iomap convesion) and the bdev large folio series form Luis. They will
release the first version after testing as soon as possible.
Best regards,
Yi.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LBS support for EXT4
2025-06-21 2:54 ` Zhang Yi
@ 2025-06-23 13:22 ` Pankaj Raghav
0 siblings, 0 replies; 10+ messages in thread
From: Pankaj Raghav @ 2025-06-23 13:22 UTC (permalink / raw)
To: Zhang Yi, Jan Kara; +Cc: tytso, Luis Chamberlain, Pankaj Raghav, linux-ext4
>> I think better spent time would be to help with the iomap conversion. I
>> don't think there will be that much coding left (perhaps some more exotic
>> features need attention) but there's definitely testing needed and review
>> is always welcome and most needed...
>>
>
> My colleagues, Baokun and Zhihao, have been working on LBS support for a
> couple of months, based on my two large folio series (buffer_head and
> iomap convesion) and the bdev large folio series form Luis. They will
> release the first version after testing as soon as possible.
>
That is great. Feel free to CC me and Luis. We can help with reviewing and testing
the patches. :)
--
Pankaj
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LBS support for EXT4
2025-06-20 15:55 ` LBS support for EXT4 Jan Kara
2025-06-21 0:25 ` Baokun Li
2025-06-21 2:54 ` Zhang Yi
@ 2025-06-23 13:14 ` Pankaj Raghav
2025-06-23 14:17 ` Theodore Ts'o
2 siblings, 1 reply; 10+ messages in thread
From: Pankaj Raghav @ 2025-06-23 13:14 UTC (permalink / raw)
To: Jan Kara
Cc: tytso, Luis Chamberlain, Pankaj Raghav, linux-ext4, Zhang Yi,
Baokun Li
Thanks a lot Jan, Zhang and Baokun. I think now I have a clear idea on IOMAP and LBS efforts
for EXT4.
>> The reason I am asking is, should I take up the challenge to add LBS
>> support with buffer heads in EXT4, or should I wait until iomap patches
>> are merged.
>
> I think better spent time would be to help with the iomap conversion. I
> don't think there will be that much coding left (perhaps some more exotic
> features need attention) but there's definitely testing needed and review
> is always welcome and most needed...
>
We will definitely help reviewing and testing the IOMAP and LBS patches. :)
--
Pankaj
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LBS support for EXT4
2025-06-23 13:14 ` Pankaj Raghav
@ 2025-06-23 14:17 ` Theodore Ts'o
2025-06-25 11:13 ` Pankaj Raghav (Samsung)
0 siblings, 1 reply; 10+ messages in thread
From: Theodore Ts'o @ 2025-06-23 14:17 UTC (permalink / raw)
To: Pankaj Raghav
Cc: Jan Kara, Luis Chamberlain, Pankaj Raghav, linux-ext4, Zhang Yi,
Baokun Li
If you want to review and test the ext4/iomap changes, that would be
great. Be aware, though, that there are some features of ext4
(example: data journalling, fscrypt, fsverity, etc.) that the current
iomap buffered I/O code may not support today. The alternatives are
to keep the existing ext4 code paths for those file system features,
or to try to add that functionality into iomap. There are of course
tradeoffs to both alternatives; one might result in more code that we
have to maintain; the other might require a lot more work.
It _might_ be less effort to add LBS support to native ext4 code. I
think the main thing is to make sure that we always we use a large
folio and not fall back to a sub-blocksize set of pages. So again,
it's all about tradeoffs and what you consider to be the highest
priority.
For myself, my primary concern is to keep the code maintainable and to
not result in any test regressions. If your goal is to get more file
systems to use iomap for buffered I/O, that might be different than
those who are aiming to get performance or improved hardware support
ASAP as your higher priority. I will say that in the ideal world, we
would eventually migrate to use the iomap code for buffered I/O for at
least the most common case. But if we end up having an intermediate
way station where we have large folio support for LBS before we get to
that desired end state, I'm open to that, so long as the code stays
maintainable and bug-free(tm). :-)
Cheers,
- Ted
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LBS support for EXT4
2025-06-23 14:17 ` Theodore Ts'o
@ 2025-06-25 11:13 ` Pankaj Raghav (Samsung)
2025-06-25 11:51 ` Baokun Li
0 siblings, 1 reply; 10+ messages in thread
From: Pankaj Raghav (Samsung) @ 2025-06-25 11:13 UTC (permalink / raw)
To: Theodore Ts'o
Cc: Jan Kara, Luis Chamberlain, Pankaj Raghav, linux-ext4, Zhang Yi,
Baokun Li
Thanks for the reply, Ted.
On Mon, Jun 23, 2025 at 10:17:53AM -0400, Theodore Ts'o wrote:
> If you want to review and test the ext4/iomap changes, that would be
> great. Be aware, though, that there are some features of ext4
> (example: data journalling, fscrypt, fsverity, etc.) that the current
> iomap buffered I/O code may not support today. The alternatives are
> to keep the existing ext4 code paths for those file system features,
> or to try to add that functionality into iomap. There are of course
> tradeoffs to both alternatives; one might result in more code that we
> have to maintain; the other might require a lot more work.
>
> It _might_ be less effort to add LBS support to native ext4 code. I
> think the main thing is to make sure that we always we use a large
> folio and not fall back to a sub-blocksize set of pages. So again,
> it's all about tradeoffs and what you consider to be the highest
> priority.
@Baokun are your LBS patches based on the native ext4 code or on top of
Zhang's iomap patches.
>
> For myself, my primary concern is to keep the code maintainable and to
> not result in any test regressions. If your goal is to get more file
> systems to use iomap for buffered I/O, that might be different than
> those who are aiming to get performance or improved hardware support
> ASAP as your higher priority. I will say that in the ideal world, we
> would eventually migrate to use the iomap code for buffered I/O for at
> least the most common case. But if we end up having an intermediate
> way station where we have large folio support for LBS before we get to
> that desired end state, I'm open to that, so long as the code stays
> maintainable and bug-free(tm). :-)
>
This makes sense. Thanks, Ted.
--
Pankaj Raghav
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LBS support for EXT4
2025-06-25 11:13 ` Pankaj Raghav (Samsung)
@ 2025-06-25 11:51 ` Baokun Li
2025-06-25 12:25 ` Pankaj Raghav (Samsung)
2025-06-25 12:39 ` Theodore Ts'o
0 siblings, 2 replies; 10+ messages in thread
From: Baokun Li @ 2025-06-25 11:51 UTC (permalink / raw)
To: Pankaj Raghav (Samsung)
Cc: Jan Kara, Luis Chamberlain, Pankaj Raghav, linux-ext4, Zhang Yi,
Theodore Ts'o
On 2025/6/25 19:13, Pankaj Raghav (Samsung) wrote:
> Thanks for the reply, Ted.
>
> On Mon, Jun 23, 2025 at 10:17:53AM -0400, Theodore Ts'o wrote:
>> If you want to review and test the ext4/iomap changes, that would be
>> great. Be aware, though, that there are some features of ext4
>> (example: data journalling, fscrypt, fsverity, etc.) that the current
>> iomap buffered I/O code may not support today. The alternatives are
>> to keep the existing ext4 code paths for those file system features,
>> or to try to add that functionality into iomap. There are of course
>> tradeoffs to both alternatives; one might result in more code that we
>> have to maintain; the other might require a lot more work.
>>
>> It _might_ be less effort to add LBS support to native ext4 code. I
>> think the main thing is to make sure that we always we use a large
>> folio and not fall back to a sub-blocksize set of pages. So again,
>> it's all about tradeoffs and what you consider to be the highest
>> priority.
> @Baokun are your LBS patches based on the native ext4 code or on top of
> Zhang's iomap patches.
Now that mainline ext4 supports buffer head large folios, we'll first
focus on LBS support based on buffer heads. The main work involves adapting
ext4's internal logic (e.g., block allocation, read/write operations,
defragmentation) and clean up the process related to buffer head.
This doesn't conflict with iomap buffer write support. The iomap framework
already supports LBS (as xfs is already using it), so once ext4's internal
logic is adapted, Zhang Yi's iomap buffer write patches should also support
LBS upon their merge.
Cheers,
Baokun
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LBS support for EXT4
2025-06-25 11:51 ` Baokun Li
@ 2025-06-25 12:25 ` Pankaj Raghav (Samsung)
2025-06-25 12:39 ` Theodore Ts'o
1 sibling, 0 replies; 10+ messages in thread
From: Pankaj Raghav (Samsung) @ 2025-06-25 12:25 UTC (permalink / raw)
To: Baokun Li
Cc: Jan Kara, Luis Chamberlain, Pankaj Raghav, linux-ext4, Zhang Yi,
Theodore Ts'o
On Wed, Jun 25, 2025 at 07:51:56PM +0800, Baokun Li wrote:
> On 2025/6/25 19:13, Pankaj Raghav (Samsung) wrote:
> > Thanks for the reply, Ted.
> >
> > On Mon, Jun 23, 2025 at 10:17:53AM -0400, Theodore Ts'o wrote:
> > > If you want to review and test the ext4/iomap changes, that would be
> > > great. Be aware, though, that there are some features of ext4
> > > (example: data journalling, fscrypt, fsverity, etc.) that the current
> > > iomap buffered I/O code may not support today. The alternatives are
> > > to keep the existing ext4 code paths for those file system features,
> > > or to try to add that functionality into iomap. There are of course
> > > tradeoffs to both alternatives; one might result in more code that we
> > > have to maintain; the other might require a lot more work.
> > >
> > > It _might_ be less effort to add LBS support to native ext4 code. I
> > > think the main thing is to make sure that we always we use a large
> > > folio and not fall back to a sub-blocksize set of pages. So again,
> > > it's all about tradeoffs and what you consider to be the highest
> > > priority.
> > @Baokun are your LBS patches based on the native ext4 code or on top of
> > Zhang's iomap patches.
> Now that mainline ext4 supports buffer head large folios, we'll first
> focus on LBS support based on buffer heads. The main work involves adapting
> ext4's internal logic (e.g., block allocation, read/write operations,
> defragmentation) and clean up the process related to buffer head.
Makes sense. When we added the LBS support to XFS, the changes in XFS
itself was very minimal. But I can imagine there is a bit more work and
testing involved in adding LBS support to EXT4 with buffer heads.
> This doesn't conflict with iomap buffer write support. The iomap framework
> already supports LBS (as xfs is already using it), so once ext4's internal
> logic is adapted, Zhang Yi's iomap buffer write patches should also support
> LBS upon their merge.
Yes. iomap has all the logic to handle LBS.
Thanks for the clarification. Looking forward to the patches.
--
Pankaj Raghav
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: LBS support for EXT4
2025-06-25 11:51 ` Baokun Li
2025-06-25 12:25 ` Pankaj Raghav (Samsung)
@ 2025-06-25 12:39 ` Theodore Ts'o
1 sibling, 0 replies; 10+ messages in thread
From: Theodore Ts'o @ 2025-06-25 12:39 UTC (permalink / raw)
To: Baokun Li
Cc: Pankaj Raghav (Samsung), Jan Kara, Luis Chamberlain,
Pankaj Raghav, linux-ext4, Zhang Yi
On Wed, Jun 25, 2025 at 07:51:56PM +0800, Baokun Li wrote:
> Now that mainline ext4 supports buffer head large folios, we'll first
> focus on LBS support based on buffer heads. The main work involves adapting
> ext4's internal logic (e.g., block allocation, read/write operations,
> defragmentation) and clean up the process related to buffer head.
That makes sense; ext4 uses buffer heads for metadata blocks, and so
even if we were using the buffered iomap code, that only is relevant
to the data path, so the changes so that jbd2 and ext4 can suport
large blocks while updating inode table blocks, allocation bitmaps,
etc. would be needed anyway.
Cheers,
- Ted
^ permalink raw reply [flat|nested] 10+ messages in thread