Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      As Andreas noted in LU-13798, the faster DIO path makes it interesting to switch from buffered i/o to direct i/o at larger sizes.

      This is actually pretty easy:
      If the buffered i/o meets the alignment requirements for DIO (buffers is page aligned and i/o size is a multiple of page size), you can simply set the DIO flag internally in Lustre, and the kernel will direct the i/o to the direct i/o code.  (In newer kernels, this does not require manipulating the O_DIRECT flag on the file, which is good because that's likely unsafe.)

      If the buffered i/o is not valid as direct i/o, the usual "fall back to buffered i/o" mechanism (implemented as part of LU-4198) happens automatically (just return 0 instead of -EINVAL).

       

      The question, then, is how to decide when to switch from buffered i/o to DIO.  I have a proposed solution that I haven't implemented yet*, which I'll describe here.
      *(I have done BIO (buffered i/o) as DIO, but I used a simple "Try all BIO as DIO" patch, not intelligent switching.)

      Essentially, direct i/o performance is a function of how much parallelism we can get by splitting the i/o, and the sync time of the back end storage.

      For example, on my flash back end, I see a benefit from switching 1 MiB BIO to 4x256 KiB DIO (1.9 GiB/s instead of 1.3 GiB/s).  But a spinning disk back end would require a much larger size for this change to make sense.

       

      So the basic question to answer is, what size of i/o do we submit?  How small & in to how many chunks do we split up the i/o?

      Note if our submitted i/o size at the higher levels is larger than stripe size or RPC size, it's automatically split to those boundaries, so if we start submitting at very large sizes, we split on those boundaries instead.

      Here's my thinking.

      We have two basic tunables, one of which has a version for rotational and non-rotational backends.

      The tunables are "preferred minimum i/o size" and "desired submission concurrency" (I'm not proud of the name of the second one, open to suggestions...).

       

      So, consider a situation where we have a preferred minimum size of 256 KiB and a desired submission concurrency of 8.

      If we do a 256 KiB BIO, that is done as buffered i/o.  If we do a 400 KiB BIO, still buffered.  But if we do a 512 KiB BIO, we split it in two 256 KiB DIOs.  A 700 KiB BIO is 2x256 KiB +188 KiB DIOs.  (These thresholds may be too small.)

      Now, consider larger sizes.  1 MiB becomes 4x256 KiB.  Then, 2 MiB 8x256 KiB submissions.

      But at larger sizes, the desired submission concurrency comes in to play.  Consider 4 MiB.  4 MiB/8 = 512 KiB.  So we split 4 MiB in to 8x512 KiB.  This model prevents us from submitting many tiny i/os once the i/o size is large enough.

      Note that I have not tested this much yet - I think 8 might be low for submission concurrency and 16 might be more desirable.  Basically, this is "try to cut the i/o in to this many RPCs", so perhaps concurrency is the wrong word...?

      Also, as I noted earlier, the preferred i/o size will be very different for spinning disk vs non-rotational media.  So we will need two values for this (I am thinking we default spinning disk to some multiple of rotational and let people override), and we will also need to make this info available on the client.

      I'll ask about that in a comment.  I've also got some benchmark info I can share later - But, basically, buffered i/o through this path performs exactly like DIO through this path.

      Attachments

        Issue Links

          Activity

            [LU-13802] New i/o path: Buffered i/o as DIO

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52596/
            Subject: LU-13802 llite: add hybrid IO switch proc stats
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 7ee0d88278a1bc0d484ebe6c37c23c8ac07133ef

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52596/ Subject: LU-13802 llite: add hybrid IO switch proc stats Project: fs/lustre-release Branch: master Current Patch Set: Commit: 7ee0d88278a1bc0d484ebe6c37c23c8ac07133ef

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52595/
            Subject: LU-13802 llite: add read & write switch thresholds
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 7bbf65035916c1e94d7c19b94cadc85107523688

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52595/ Subject: LU-13802 llite: add read & write switch thresholds Project: fs/lustre-release Branch: master Current Patch Set: Commit: 7bbf65035916c1e94d7c19b94cadc85107523688

            "Patrick Farrell <patrick.farrell@oracle.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/54901
            Subject: LU-13802 tests: Test Janitor testing
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 1c5088578440f12e79fe442ac0247009dba22028

            gerrit Gerrit Updater added a comment - "Patrick Farrell <patrick.farrell@oracle.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/54901 Subject: LU-13802 tests: Test Janitor testing Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 1c5088578440f12e79fe442ac0247009dba22028

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/54099/
            Subject: LU-13802 ptlrpc: correctly remove inflight request
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 0661102dea52e7f21636b0ed808ebf037b946954

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/54099/ Subject: LU-13802 ptlrpc: correctly remove inflight request Project: fs/lustre-release Branch: master Current Patch Set: Commit: 0661102dea52e7f21636b0ed808ebf037b946954

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52593/
            Subject: LU-13802 llite: add fail loc to force bio-dio switch
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: c633a42f11aa0277f2cabae085d2ee095eab68ce

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52593/ Subject: LU-13802 llite: add fail loc to force bio-dio switch Project: fs/lustre-release Branch: master Current Patch Set: Commit: c633a42f11aa0277f2cabae085d2ee095eab68ce

            "Patrick Farrell (883)" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/54209
            Subject: LU-13802 tests: hang testing 2
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 9df3936e6094119e2e7b31898b1f81328b3a8a5b

            gerrit Gerrit Updater added a comment - "Patrick Farrell (883)" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/54209 Subject: LU-13802 tests: hang testing 2 Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 9df3936e6094119e2e7b31898b1f81328b3a8a5b

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52592/
            Subject: LU-13802 llite: add hybrid IO SBI flag
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: ea32eb39b8668dbbbe8f3de2e25825e3b1a9df51

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52592/ Subject: LU-13802 llite: add hybrid IO SBI flag Project: fs/lustre-release Branch: master Current Patch Set: Commit: ea32eb39b8668dbbbe8f3de2e25825e3b1a9df51

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52703/
            Subject: LU-13802 llite: tag switched hybrid IOs
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 3fc4243da7efd4426b6493ae212240a2e4d88747

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52703/ Subject: LU-13802 llite: tag switched hybrid IOs Project: fs/lustre-release Branch: master Current Patch Set: Commit: 3fc4243da7efd4426b6493ae212240a2e4d88747

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52586/
            Subject: LU-13802 llite: trivial bio_dio switch check
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: aab76b31539efe6e20e35c2d926c9724042fc690

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52586/ Subject: LU-13802 llite: trivial bio_dio switch check Project: fs/lustre-release Branch: master Current Patch Set: Commit: aab76b31539efe6e20e35c2d926c9724042fc690

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52587/
            Subject: LU-13802 llite: refactor ll_file_io_generic decs
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 947bcaba646e41176e3a2895e4932a182dd7d505

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52587/ Subject: LU-13802 llite: refactor ll_file_io_generic decs Project: fs/lustre-release Branch: master Current Patch Set: Commit: 947bcaba646e41176e3a2895e4932a182dd7d505

            People

              paf Patrick Farrell (Inactive)
              paf0186 Patrick Farrell
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated: