[LU-3606] Implement fallocate() support for ldiskfs Lustre Created: 17/Jul/13 Updated: 30/Nov/23 Resolved: 27/Nov/20 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.14.0 |
| Type: | New Feature | Priority: | Major |
| Reporter: | Andreas Dilger | Assignee: | Arshad Hussain |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | medium, patch | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Rank (Obsolete): | 9150 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
The sys_fallocate() syscall was introduced to the linux kernel in the 2.6.24 kernel. There is also an ext4_fallocate() method added in this same kernel release. This has been available in vendor kernels since RHEL 5.4. We need to implement an fallocate() method for llite, and transport this to the OSTs to interface with the underlying OSD's fallocate() code (for ldiskfs, ZFS has no such method). The FALLOC_FL_PUNCH_HOLE functionality of fallocate() fits very nicely with the OST_PUNCH RPC, since this was anticipated in Lustre from the beginning. The actual space reservation might also use OST_PUNCH or OST_WRITE, or we might consider a new OST_PREALLOC RPC, depending on what fits best. |
| Comments |
| Comment by Andreas Dilger [ 17/Jul/13 ] |
|
The fallocate() API has been added to newer versions of the Lustre kernel to provide both persistent space reservation (block preallocation for a file, possibly beyond the file size, without having to write zeroes to the whole file), and for the reverse operation of hole punching (freeing allocated blocks in the middle or end of a file). However, Lustre predates these APIs and has not yet added support for them. Being able to preallocate space for a file is very useful for HPC applications that know the size of the output file in advance, and helps Lustre make better allocation decisions based on the file size. This project will touch all of the layers of the Lustre IO stack, from the Linux client VFS interface, through the file layout to the RPC interface, over to the storage server, and then interfacing with the back-end filesystems to use the space reservation (ext4 only) and hole punch (both ext4 and ZFS) methods. As a stretch goal, an ioctl() pass-through interface from the server mountpoint to the underlying filesystem would allow direct passing of FITRIM ioctl commands to the storage so that SSD-based filesystems can optimize their internal space management. |
| Comment by Swapnil Pimpale (Inactive) [ 14/Feb/14 ] |
|
I have uploaded the first patchset here: http://review.whamcloud.com/#/c/9275/ |
| Comment by Jinshan Xiong (Inactive) [ 16/Feb/14 ] |
|
I will track the state of this ticket. |
| Comment by Andreas Dilger [ 07/May/15 ] |
|
Jinshan, can you see what is needed to get this patch across the finish line? Swap il is no longer available to work on it. |
| Comment by Abrar-ahmed [ 31/May/17 ] |
|
andreas.dilger@intel.com |
| Comment by Andreas Dilger [ 01/Jun/17 ] |
|
Yes, please reuse the same Change-Id. That will allow comparing the new patch against the old one, and the old one is hopelessly outdated and not useful. |
| Comment by Gerrit Updater [ 18/Jan/20 ] |
|
Arshad Hussain (arshad.super@gmail.com) uploaded a new patch: https://review.whamcloud.com/37273 |
| Comment by Gerrit Updater [ 19/Jan/20 ] |
|
Arshad Hussain (arshad.super@gmail.com) uploaded a new patch: https://review.whamcloud.com/37277 |
| Comment by Gerrit Updater [ 28/Jan/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37273/ |
| Comment by Gerrit Updater [ 28/Jan/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37277/ |
| Comment by Gerrit Updater [ 14/May/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/9275/ |
| Comment by Peter Jones [ 26/Nov/20 ] |
|
Do I understand correctly that fallocate support for ldiskfs has landed for 2.14 but fallocate support for ZFS needs more work? If so, shall we track the latter under a new ticket so that it is clear what capabilities are in each release? |
| Comment by Andreas Dilger [ 27/Nov/20 ] |
|
Yes, the patch https://review.whamcloud.com/36506 " |
| Comment by Peter Jones [ 27/Nov/20 ] |
|
Opened LU-14157 to track fallocate support for zfs. Marking as fixed in 2.14 for ldiskfs support |
| Comment by Arshad Hussain [ 30/Nov/20 ] |
|
Thanks Andreas, Peter. >Opened LU-14157 to track fallocate support for zfs. Marking as fixed in 2.14 for ldiskfs support |