Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • Lustre 2.14.0
    • None
    • 9223372036854775807

    Description

      Kernels 4.10 and later (since commit a528d35e8b) have an enhanced statx() interface that can specify a bitmask to fetch specific attributes from a file (e.g. st_uid, st_gid, st_mode, and st_btime == file creation time), rather than fetching all of the normal stat() attributes (such as st_size and st_blocks). It also has a AT_STATX_DONT_SYNC mode which allows the kernel to return "lazy" stats without flushing all of the client data and fetching an accurate result from the server.

      This matches (not coincidentally) very well with the Lustre attribute mechanism, and could be advantageous for fetching attributes from ls --color (needs st_mode) without having to do a glimpse to fetch the size (which is just discarded anyway).

      The Lustre patch https://review.whamcloud.com/27715 "LU-9558 llite: user enhanced getattr functionality in newer kernels" added very basic support for this interface, but it only went so far as to handle the kernel API changes, but doesn't actually handle the different attribute flags appropriately (it currently fetches and returns all normal attributes - STATX_BASIC_STATS). This interface should be wired up properly so that we can take advantage of the efficiencies available.

      • only fetch MDS attributes if STATX_SIZE and STATX_BLOCKS are not requested, and avoid OSS glimpse RPCs completely
      • hook this into statahead to avoid async glimpse locks (AGL) if OST information not needed
      • enhance the MDS RPC interface to return the file creation time stored in both ldiskfs and ZFS already, and enable STATX_BTIME
      • in conjunction with Lazy Size-on-MDT (LSOM, LU-9538) return the LSOM size if AT_STATX_DONT_SYNC is used

      Attachments

        Issue Links

          Activity

            [LU-10934] integrate statx() API with Lustre

            tests sanityn/106* seem to be broken - even recent debugfs doesn't dump "btime".
            probably crtime was meant?

            bzzz Alex Zhuravlev added a comment - tests sanityn/106* seem to be broken - even recent debugfs doesn't dump "btime". probably crtime was meant?
            pjones Peter Jones added a comment -

            Landed for 2.14

            pjones Peter Jones added a comment - Landed for 2.14

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36674/
            Subject: LU-10934 llite: integrate statx() API with Lustre
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 3f7853b31ef6f5a6c2837403910083057728a842

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36674/ Subject: LU-10934 llite: integrate statx() API with Lustre Project: fs/lustre-release Branch: master Current Patch Set: Commit: 3f7853b31ef6f5a6c2837403910083057728a842

            Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/36674
            Subject: LU-10934 llite: integrate statx() API with Lustre
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 3bb2844b25767676ab56946a00aff16f02a82db9

            gerrit Gerrit Updater added a comment - Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/36674 Subject: LU-10934 llite: integrate statx() API with Lustre Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 3bb2844b25767676ab56946a00aff16f02a82db9
            adilger Andreas Dilger added a comment - The coreutils commit is at: https://github.com/coreutils/coreutils/commit/a99ab266110795ed94a9cb4d2765ddad9c4310da

            Nice Andreas!

            Do you have a pointer for this change? Does this mean this is optimized and only statx() is used when possible?

             

            degremoa Aurelien Degremont (Inactive) added a comment - Nice Andreas! Do you have a pointer for this change? Does this mean this is optimized and only statx() is used when possible?  

            The support for stat(1) and ls(1) to use statx(3) to fetch only the required attributes has landed to the upstream GNU coreutils package.

            adilger Andreas Dilger added a comment - The support for stat(1) and ls(1) to use statx(3) to fetch only the required attributes has landed to the upstream GNU coreutils package.

            There is a very preliminary patch to add statx() support to ls at: https://github.com/jtlayton/coreutils/commits/statx

            adilger Andreas Dilger added a comment - There is a very preliminary patch to add statx() support to ls at: https://github.com/jtlayton/coreutils/commits/statx

            For Lustre the second call will likely just read data from cache. The performance impact should be low.

            But this is not good news. Maybe we should push coreutils in the right direction.

             

            Having a proper full statx implementation in Lustre is still useful. Robinhood can clearly benefit from it.

            degremoa Aurelien Degremont (Inactive) added a comment - For Lustre the second call will likely just read data from cache. The performance impact should be low. But this is not good news. Maybe we should push coreutils in the right direction.   Having a proper full statx implementation in Lustre is still useful. Robinhood can clearly benefit from it.

            I found that the stat command was patched to call statx() to fetch file creation time in coreutils 0.28, but unfortunately this is implemented by calling statx() again on the file, rather than calling statx() in the first place to fetch all of the required/available attributes. This means both stat() and statx() will be called on the file, increasing overhead rather than decreasing it . I didn't see other uses of statx() in the current coreutils.

            adilger Andreas Dilger added a comment - I found that the stat command was patched to call statx() to fetch file creation time in coreutils 0.28, but unfortunately this is implemented by calling statx() again on the file, rather than calling statx() in the first place to fetch all of the required/available attributes. This means both stat() and statx() will be called on the file, increasing overhead rather than decreasing it . I didn't see other uses of statx() in the current coreutils.

            As far as I've seen, ls guys are not really eager to support statx

            degremoa Aurelien Degremont (Inactive) added a comment - statx() is added to Linux (Linux 4.11+) glibc supports statx() (glibc 2.28+ -> RHEL 8, Ubuntu 18.10+) statx() takes benefit from LSOM ( https://jira.whamcloud.com/browse/LU-10934 ) ls supports statx() (TBD) As far as I've seen, ls guys are not really eager to support statx

            People

              qian_wc Qian Yingjin
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: