Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-3606

Implement fallocate() support for ldiskfs Lustre

Details

    • New Feature
    • Resolution: Fixed
    • Major
    • Lustre 2.14.0
    • None
    • 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.

      Attachments

        Issue Links

          Activity

            [LU-3606] Implement fallocate() support for ldiskfs Lustre

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/9275/
            Subject: LU-3606 fallocate: Implement fallocate preallocate operation
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 48457868a02ae5a0407f304c9028f7e80e7fb574

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/9275/ Subject: LU-3606 fallocate: Implement fallocate preallocate operation Project: fs/lustre-release Branch: master Current Patch Set: Commit: 48457868a02ae5a0407f304c9028f7e80e7fb574

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37277/
            Subject: LU-3606 lustre: Reserve OST_FALLOCATE(fallocate) opcode
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 46a11df089c92f0d18e6f3224eca76abfcd0ac67

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37277/ Subject: LU-3606 lustre: Reserve OST_FALLOCATE(fallocate) opcode Project: fs/lustre-release Branch: master Current Patch Set: Commit: 46a11df089c92f0d18e6f3224eca76abfcd0ac67

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37273/
            Subject: LU-3606 fsx: Add fallocate operation to fsx
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 853d180121a6e313ffe678bbe5c107d7afc601d5

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37273/ Subject: LU-3606 fsx: Add fallocate operation to fsx Project: fs/lustre-release Branch: master Current Patch Set: Commit: 853d180121a6e313ffe678bbe5c107d7afc601d5

            Arshad Hussain (arshad.super@gmail.com) uploaded a new patch: https://review.whamcloud.com/37277
            Subject: LU-3606 lustre: Reserve fallocate opcode
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: a52c11c2c0935ce1b741dfde703bbaeb93c7c499

            gerrit Gerrit Updater added a comment - Arshad Hussain (arshad.super@gmail.com) uploaded a new patch: https://review.whamcloud.com/37277 Subject: LU-3606 lustre: Reserve fallocate opcode Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: a52c11c2c0935ce1b741dfde703bbaeb93c7c499

            Arshad Hussain (arshad.super@gmail.com) uploaded a new patch: https://review.whamcloud.com/37273
            Subject: LU-3606 fsx: Add fallocate operation to fsx
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 2269c370864bd42a5fbf0608afecba0ec8f010db

            gerrit Gerrit Updater added a comment - Arshad Hussain (arshad.super@gmail.com) uploaded a new patch: https://review.whamcloud.com/37273 Subject: LU-3606 fsx: Add fallocate operation to fsx Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 2269c370864bd42a5fbf0608afecba0ec8f010db

            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.

            adilger Andreas Dilger added a comment - 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.

            andreas.dilger@intel.com I worked on the patch and have it working, including newer kernel versions. Most review comments against last patch addressed. Can post it against the same change-id if that works.

            abrarahmed Abrar-ahmed (Inactive) added a comment - andreas.dilger@intel.com I worked on the patch and have it working, including newer kernel versions. Most review comments against last patch addressed. Can post it against the same change-id if that works.

            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.

            adilger Andreas Dilger added a comment - 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.

            I will track the state of this ticket.

            jay Jinshan Xiong (Inactive) added a comment - I will track the state of this ticket.

            I have uploaded the first patchset here: http://review.whamcloud.com/#/c/9275/

            spimpale Swapnil Pimpale (Inactive) added a comment - I have uploaded the first patchset here: http://review.whamcloud.com/#/c/9275/

            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.

            adilger Andreas Dilger added a comment - 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.

            People

              arshad512 Arshad Hussain
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: