Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.16.0
    • Lustre 2.15.0
    • None
    • 3
    • 9223372036854775807

    Description

      On Lustre there is one strange quirk:

      DIO writing now works, assuming you are writing from an aligned buffer, you are not restricted to the 512 byte limit.

      However DIO reading of a single byte is broken, reading for more than 1 byte is okay.

      Attached test source: dio_test.c

      [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -w -d -b 1 /mnt/lustre/tmp/dio_w3.dat
      /mnt/lustre/tmp/dio_w3.dat - DIRECT WRITE 1/1 bytes
      [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
      read: 0 (EOF)
      

      If the block you are reading 1 byte from is in the PAGE_CACHE then the 1 byte read will succeed.

      [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -b 1 /mnt/lustre/tmp/dio_w3.dat
      read: 1, x'33  '
      /mnt/lustre/tmp/dio_w3.dat - BUFFER READ 1/1 bytes
      [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
      read: 1, x'33  '
      /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/1 bytes
      [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
      3
      [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
      read: 0 (EOF)
      

      So what happens when doing a DIO read of 2 or more bytes and the block is NOT in the PAGE_CACHE?

      [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
      3
      [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
      read: 0 (EOF)
      [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 2 /mnt/lustre/tmp/dio_w3.dat
      read: 1, x'33  '
      read: 0 (EOF)
      /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/2 bytes
      [shaun@alma8 dio]$ 
      

      Attachments

        Activity

          [LU-15829] DIO small reads fails
          pjones Peter Jones made changes -
          Fix Version/s New: Lustre 2.16.0 [ 15190 ]
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          pjones Peter Jones added a comment -

          Landed for 2.16

          pjones Peter Jones added a comment - Landed for 2.16

          "Alexey Lyashkov <alexey.lyashkov@hpe.com>" uploaded a new patch: https://review.whamcloud.com/47395
          Subject: LU-15829 llite: don't use a kms if it invalid.
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: b96430385b93e30f0bea1e147e0b17f28577bdcd

          gerrit Gerrit Updater added a comment - "Alexey Lyashkov <alexey.lyashkov@hpe.com>" uploaded a new patch: https://review.whamcloud.com/47395 Subject: LU-15829 llite: don't use a kms if it invalid. Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: b96430385b93e30f0bea1e147e0b17f28577bdcd
          adilger Andreas Dilger made changes -
          Affects Version/s New: Lustre 2.15.0 [ 14791 ]
          stancheff Shaun Tancheff made changes -
          Description Original: On Lustre there is one strange quirk: [^dio_test.c]

          DIO writing now works, assuming you are writing from an aligned buffer, you are not restricted to the 512 byte limit.

          However DIO reading of a single byte is broken, reading for more than 1 byte is okay.

          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -w -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          /mnt/lustre/tmp/dio_w3.dat - DIRECT WRITE 1/1 bytes
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          If the block you are reading 1 byte from is in the PAGE_CACHE then the 1 byte read will succeed.

          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          /mnt/lustre/tmp/dio_w3.dat - BUFFER READ 1/1 bytes
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/1 bytes
          [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
          3
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          So what happens when doing a DIO read of 2 or more bytes and the block is NOT in the PAGE_CACHE?

          [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
          3
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 2 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          read: 0 (EOF)
          /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/2 bytes
          [shaun@alma8 dio]$
          New: On Lustre there is one strange quirk:

          DIO writing now works, assuming you are writing from an aligned buffer, you are not restricted to the 512 byte limit.

          However DIO reading of a single byte is broken, reading for more than 1 byte is okay.

          Attached test source: [^dio_test.c]

          {noformat}
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -w -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          /mnt/lustre/tmp/dio_w3.dat - DIRECT WRITE 1/1 bytes
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          {noformat}

          If the block you are reading 1 byte from is in the PAGE_CACHE then the 1 byte read will succeed.

          {noformat}
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          /mnt/lustre/tmp/dio_w3.dat - BUFFER READ 1/1 bytes
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/1 bytes
          [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
          3
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          {noformat}

          So what happens when doing a DIO read of 2 or more bytes and the block is NOT in the PAGE_CACHE?

          {noformat}
          [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
          3
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 2 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          read: 0 (EOF)
          /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/2 bytes
          [shaun@alma8 dio]$
          {noformat}

          stancheff Shaun Tancheff made changes -
          Description Original: On Lustre there is one strange quirk:

          DIO writing now works, assuming you are writing from an aligned buffer, you are not restricted to the 512 byte limit.

          However DIO reading of a single byte is broken, reading for more than 1 byte is okay.

          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -w -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          /mnt/lustre/tmp/dio_w3.dat - DIRECT WRITE 1/1 bytes
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          If the block you are reading 1 byte from is in the PAGE_CACHE then the 1 byte read will succeed.

          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          /mnt/lustre/tmp/dio_w3.dat - BUFFER READ 1/1 bytes
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/1 bytes
          [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
          3
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          So what happens when doing a DIO read of 2 or more bytes and the block is NOT in the PAGE_CACHE?

          [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
          3
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 2 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          read: 0 (EOF)
          /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/2 bytes
          [shaun@alma8 dio]$
          New: On Lustre there is one strange quirk: [^dio_test.c]

          DIO writing now works, assuming you are writing from an aligned buffer, you are not restricted to the 512 byte limit.

          However DIO reading of a single byte is broken, reading for more than 1 byte is okay.

          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -w -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          /mnt/lustre/tmp/dio_w3.dat - DIRECT WRITE 1/1 bytes
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          If the block you are reading 1 byte from is in the PAGE_CACHE then the 1 byte read will succeed.

          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          /mnt/lustre/tmp/dio_w3.dat - BUFFER READ 1/1 bytes
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/1 bytes
          [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
          3
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          So what happens when doing a DIO read of 2 or more bytes and the block is NOT in the PAGE_CACHE?

          [shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
          3
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
          read: 0 (EOF)
          [shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 2 /mnt/lustre/tmp/dio_w3.dat
          read: 1, x'33 '
          read: 0 (EOF)
          /mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/2 bytes
          [shaun@alma8 dio]$
          stancheff Shaun Tancheff made changes -
          Attachment New: dio_test.c [ 43553 ]

          "Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/47225
          Subject: LU-15829 clio: Force buffered I/O on small reads
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 57f500ecaada808af3a2fb5f5dd5d895d5a6aa3b

          gerrit Gerrit Updater added a comment - "Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/47225 Subject: LU-15829 clio: Force buffered I/O on small reads Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 57f500ecaada808af3a2fb5f5dd5d895d5a6aa3b
          stancheff Shaun Tancheff created issue -

          People

            stancheff Shaun Tancheff
            stancheff Shaun Tancheff
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: