Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.8.0
    • Lustre 2.7.0
    • 3
    • 17093

    Description

      q:lustre-release# git describe
      2.6.92-55-g2bc5bcb
      q:lustre-release# unset MDSCOUNT
      q:lustre-release# llmount.sh
      ...
      q:lustre-release# cd /mnt/lustre
      q:lustre# mkdir d0
      q:lustre# touch d0/f{0..1023}
      q:lustre# strace -o /tmp/1 lfs find --size +4K .
      ./d0
      q:lustre-release# awk -F'(' '{ print $1; }' /tmp/1 | sort | uniq -c
            1 access
            1 arch_prctl
            3 brk
         1034 close
            1 execve
            1 exit_group
            1 fcntl
            8 fstat
            4 getdents
            1 gettimeofday
         3077 ioctl
         1024 lstat
           20 mmap
            9 mprotect
            2 munmap
         1034 open
            6 read
            1 write
      q:lustre-release# grep ioctl /tmp/1 | sort | uniq -c
            1 ioctl(3, 0x800466af, 0x7ffff9778e00)    = 0
            1 ioctl(3, 0xc0086683, 0x7ffff9778890)    = 0
            1 ioctl(3, 0xc0086917, 0x2354040)         = 0
            1 ioctl(4, 0x800466af, 0x7ffff9778e00)    = 0
         1024 ioctl(4, 0xc00866a5, 0x2354040)         = 0 # IOC_LOV_GETINFO
         1024 ioctl(4, 0xc0086916, 0x2354040)         = 0 # IOC_MDC_GETFILEINFO
            1 ioctl(4, 0xc0086917, 0x2354040)         = 0 # LL_IOC_MDC_GETINFO
         1024 ioctl(5, 0x800466af, 0x7ffff9778e00)    = 0 # LL_IOC_GET_MDTIDX
      

      For each file returned by getdents on d0 we do:

      ioctl(4, 0xc0086916, 0x2354040)         = 0 # IOC_MDC_GETFILEINFO
      lstat("./d0/f831", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
      open("./d0/f831", O_RDONLY)             = 5
      ioctl(5, 0x800466af, 0x7ffff9778e00)    = 0 # LL_IOC_GET_MDTIDX
      close(5)                                = 0
      ioctl(4, 0xc00866a5, 0x2354040)         = 0 # IOC_LOV_GETINFO
      

      Attachments

        Issue Links

          Activity

            [LU-6134] lfs find --size opens everything
            pjones Peter Jones added a comment -

            Landed for 2.8

            pjones Peter Jones added a comment - Landed for 2.8

            Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/13822/
            Subject: LU-6134 utils: lfs should only open/stat files if needed
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 9c4783a744f27da813b9c5be9c530f7772eec203

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/13822/ Subject: LU-6134 utils: lfs should only open/stat files if needed Project: fs/lustre-release Branch: master Current Patch Set: Commit: 9c4783a744f27da813b9c5be9c530f7772eec203

            Andreas Dilger (andreas.dilger@intel.com) uploaded a new patch: http://review.whamcloud.com/13822
            Subject: LU-6134 utils: lfs should only open/stat files if needed
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 363e65f2080aa6cd9b91e3c99d470528428e81df

            gerrit Gerrit Updater added a comment - Andreas Dilger (andreas.dilger@intel.com) uploaded a new patch: http://review.whamcloud.com/13822 Subject: LU-6134 utils: lfs should only open/stat files if needed Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 363e65f2080aa6cd9b91e3c99d470528428e81df

            It seems that this is also preventing lfs find --ost from working when an OST is offline, since the added fstat() will fail if the file is on an OST that is offline (LU-1738), which is one of the main reasons to use lfs find --ost in the first place. Will push a patch shortly.

            adilger Andreas Dilger added a comment - It seems that this is also preventing lfs find --ost from working when an OST is offline, since the added fstat() will fail if the file is on an OST that is offline ( LU-1738 ), which is one of the main reasons to use lfs find --ost in the first place. Will push a patch shortly.

            Di, it looks like this was landed back in 2.2 in commit 322968ac "LU-819 utils: Fix lfs getstripe -M" (http://review.whamcloud.com/1646) in order to implement the lfs find --mdt. However, if lfs find isn't actually using this option then it doesn't need to get the MDT index at all. Opening and closing each file adds a significant amount of overhead to this code that could easily be avoided.

            adilger Andreas Dilger added a comment - Di, it looks like this was landed back in 2.2 in commit 322968ac " LU-819 utils: Fix lfs getstripe -M" ( http://review.whamcloud.com/1646 ) in order to implement the lfs find --mdt . However, if lfs find isn't actually using this option then it doesn't need to get the MDT index at all. Opening and closing each file adds a significant amount of overhead to this code that could easily be avoided.

            People

              di.wang Di Wang
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: