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

DIO performance: cl_page struct removal for DIO path

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • 9223372036854775807

    Description

      When doing DIO at ~10 GiB/s (see LU-13798LU-13799), about 70-75% of the time is still spent on working with the cl_page struct.

      This means allocating it, setting it up, and then moving it around & managing it.  We use the cl_page to track the vm pages, and in doing so, we put it on lists and move it from list to list, and update the state of the cl_page... (literally, cl_page_state)

      It's possible to improve this by doing cl_page allocations in batch, this results in roughly a 30% drop in time spent in cl_page work, and makes it possible to get close to 15 GiB/s.

      Fundamentally, none of this is necessary for DIO.  The cl_page struct is for tracking per-page information, but all of the pages in a DIO submission (at the ll_direct_rw_page level) are the same - They have the same owner, the same page flags, they are part of the same stripe...  If we do unaligned DIO, the first and last page can have a starting & ending offset, but that's it, and we can associate that with the DIO itself, not the individual pages.

      So the proposal is to switch from using the cl_page struct to track pages in a DIO, and instead use the array of pages which describes the user buffer (ie, the kiocb and the results of ll_get_user_pages).

      The brw_page member of the cl_page struct seems like it will still be necessary, but this isn't such a big deal - We can allocate those separately, at a fraction of the cost of setting up and managing the full cl_page abstraction.

      Back of the envelope calculations suggest that this would save about 60-75% of the time in submitting DIO in the current optimized path, which performs at 10 GiB/s.

       

      That calculation suggests we could reach single threaded DIO performance in the 25-40 GiB/s range.  Presumably some other issues will prevent hitting such high rates, but I think it is reasonable to think we could reach 20+ GiB/s, with sufficient network hardware.  (We will likely have to accept "idle CPU time in the submitting thread while waiting for the network" as a proxy indicator, since networks in the 30 GiB/s/node range are not readily available for testing.)

      This improvement would of course also apply to buffered i/o via this path (see LU-13805), with the fast buffering version seeing a smaller benefit (but still large).

      This change would also likely make it easier (from a coding perspective) to move the buffer allocation & memcopy() in the ptlrpcd threads, which is a key part of improving the performance of the fast buffering.

      Attachments

        Issue Links

          Activity

            [LU-13814] DIO performance: cl_page struct removal for DIO path

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52161/
            Subject: LU-13814 osc: reduce queue use in __osc_dio_submit
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 14575563dea23fbb3417b64fd164cbc3da866469

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52161/ Subject: LU-13814 osc: reduce queue use in __osc_dio_submit Project: fs/lustre-release Branch: master Current Patch Set: Commit: 14575563dea23fbb3417b64fd164cbc3da866469

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52160/
            Subject: LU-13814 osc: begin converting queue_dio_pages
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: be8e3958845f503beaf094c94183d931424fb6d1

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52160/ Subject: LU-13814 osc: begin converting queue_dio_pages Project: fs/lustre-release Branch: master Current Patch Set: Commit: be8e3958845f503beaf094c94183d931424fb6d1

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52159/
            Subject: LU-13814 osc: convert osc_dio_submit to array
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: ce6bcb9e53aa0f9c7e0593e16c31e88d4cd298aa

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52159/ Subject: LU-13814 osc: convert osc_dio_submit to array Project: fs/lustre-release Branch: master Current Patch Set: Commit: ce6bcb9e53aa0f9c7e0593e16c31e88d4cd298aa

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52141/
            Subject: LU-13814 osc: cleanup osc_completion
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 2910f279ca3a7e7388ea93000daf7c9d5b5493f9

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52141/ Subject: LU-13814 osc: cleanup osc_completion Project: fs/lustre-release Branch: master Current Patch Set: Commit: 2910f279ca3a7e7388ea93000daf7c9d5b5493f9

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52140/
            Subject: LU-13814 osc: add osc_queue_dio_pages
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 8efbad8ff4edc00b4b727f3bb6f6f0fead2c35e2

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52140/ Subject: LU-13814 osc: add osc_queue_dio_pages Project: fs/lustre-release Branch: master Current Patch Set: Commit: 8efbad8ff4edc00b4b727f3bb6f6f0fead2c35e2

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52139/
            Subject: LU-13814 osc: clarify osc_transfer_pinned usage
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: fc9adb3e8f01cd3e880e2d0e18f50e44fa445a4f

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52139/ Subject: LU-13814 osc: clarify osc_transfer_pinned usage Project: fs/lustre-release Branch: master Current Patch Set: Commit: fc9adb3e8f01cd3e880e2d0e18f50e44fa445a4f

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52136/
            Subject: LU-13814 osc: add osc_dio_submit
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 87d17d0a16ab9ad63f828004df7265c279215772

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52136/ Subject: LU-13814 osc: add osc_dio_submit Project: fs/lustre-release Branch: master Current Patch Set: Commit: 87d17d0a16ab9ad63f828004df7265c279215772

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52113/
            Subject: LU-13814 clio: convert lov submit to cl_dio_pages
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: b32321feef7b1bf4eebe8bb3ea0cc6a945e4a285

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52113/ Subject: LU-13814 clio: convert lov submit to cl_dio_pages Project: fs/lustre-release Branch: master Current Patch Set: Commit: b32321feef7b1bf4eebe8bb3ea0cc6a945e4a285

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52112/
            Subject: LU-13814 clio: rename 'cl_page_completion'
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: f00863ff25b3be68b220dd2c6b6234fd6e3a0d8e

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52112/ Subject: LU-13814 clio: rename 'cl_page_completion' Project: fs/lustre-release Branch: master Current Patch Set: Commit: f00863ff25b3be68b220dd2c6b6234fd6e3a0d8e

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52111/
            Subject: LU-13814 clio: add cl_dio_pages_complete
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 4b6cbdf80bba74d1b226ca4db220ed04d0179534

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52111/ Subject: LU-13814 clio: add cl_dio_pages_complete Project: fs/lustre-release Branch: master Current Patch Set: Commit: 4b6cbdf80bba74d1b226ca4db220ed04d0179534

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52100/
            Subject: LU-13814 clio: add cl_sync_io_note batch
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 304fb2b16d1a4d583f9749b1029d00ff51202adc

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52100/ Subject: LU-13814 clio: add cl_sync_io_note batch Project: fs/lustre-release Branch: master Current Patch Set: Commit: 304fb2b16d1a4d583f9749b1029d00ff51202adc

            People

              paf0186 Patrick Farrell
              paf0186 Patrick Farrell
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated: