Re: [RESEND PATCH 0/4] Implement File-Based optimization functionality

From: Matias Bjørling
Date: Fri Nov 04 2022 - 08:39:26 EST


On 03/11/2022 07.11, Juhyung Park wrote:
...

Is the idea really an utter madness? Majority of regular files that may be of interest from the perspective of UFS aren't reflinked or snapshotted (let alone the lack of support from ext4 or f2fs).

Device-side fragmentation is a real issue [1] and it makes more than enough sense to defrag LBAs of interests to improve performance. This was long overdue, unless the block interface itself changes somehow.

There are ongoing work with UFS to extend the block interface with zones. This approach eliminates the mismatch between the device-side mapping and host-side mapping and lets the host and device collaborate on the data placement.


The question is how to implement it correctly without creating a mess with mismatched/outdated LBAs as you've mentioned, preferably through file-system's integration: If the LBAs in questions are indeed reflinked, how do we handle it?, If the LBAs are moved/invalidated from defrag or GC, how do we make sure that UFS is up-to-date?, etc.

If using zoned UFS, the file-system can use zones for LBA tracking, eliminating the mismatched/outdated LBA issue. f2fs already supports this approach (works today with SMR HDDs and ZNS SSDs). It'll extend to UFS when zone support is added/implemented.