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

Reduce size of cl_page and associated structures

Details

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

    Description

      cl_page and its associated structures are allocated for every page, but can be shrunk down by removing unnecessary structure members.

      Attachments

        Issue Links

          Activity

            [LU-15619] Reduce size of cl_page and associated structures
            pjones Peter Jones added a comment -

            Landed for 2.16

            pjones Peter Jones added a comment - Landed for 2.16

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46715/
            Subject: LU-15619 osc: Rename brw_page members
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: f2d875daf385ae6bb98045d16d9552a486a89263

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46715/ Subject: LU-15619 osc: Rename brw_page members Project: fs/lustre-release Branch: master Current Patch Set: Commit: f2d875daf385ae6bb98045d16d9552a486a89263

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46721/
            Subject: LU-15619 osc: pack osc_async_page better
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 0bfc8eca5c3d26235846bab347d7e53b8ab0576a

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46721/ Subject: LU-15619 osc: pack osc_async_page better Project: fs/lustre-release Branch: master Current Patch Set: Commit: 0bfc8eca5c3d26235846bab347d7e53b8ab0576a

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46719/
            Subject: LU-15619 osc: Remove oap lock
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: b2274a716087fad24490f56026775886c26f74b8

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46719/ Subject: LU-15619 osc: Remove oap lock Project: fs/lustre-release Branch: master Current Patch Set: Commit: b2274a716087fad24490f56026775886c26f74b8

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46713/
            Subject: LU-15619 osc: Remove oap_magic
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 721df28648c4b3faabce709abce7d55512edbeac

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46713/ Subject: LU-15619 osc: Remove oap_magic Project: fs/lustre-release Branch: master Current Patch Set: Commit: 721df28648c4b3faabce709abce7d55512edbeac

            I was looking at whether osc_oap_page.oap_cmd could be made smaller, but I see it is already 18 bits in size:

             #define OBD_BRW_OVER_PRJQUOTA 0x8000 /* Running out of project quota */
             #define OBD_BRW_RDMA_ONLY    0x20000 /* RPC contains RDMA-only pages*/
             #define OBD_BRW_SYS_RESOURCE 0x40000 /* page has CAP_SYS_RESOURCE */
            

            Both osc_queue_async_io() and osc_page_submit() explicitly (try to) store OBD_BRW_SYS_RESOURCE in oap_cmd (also in oap_brw_flags aka oap_brw_page.flag), but not much else goes in there (OBD_BRW_WRITE, OBD_BRW_NOQUOTA).

            It doesn't look like oap_cmd is used for anything other than checking OBD_BRW_WRITE, so this could become a single bitfield, or added to oap_async_flags?

            Note that modern GCC allows you to use:

                    enum async_flags    oap_async_flags:4;
            

            to reduce the size, while keeping the consistency checks, though I don't think it makes a difference right now.

            Shrinking oap_page_off to PAGE_SIZE_BITS won't help by itself either, but gets this down to 12 bits (16 on PPC64/ARM64, since the offset is zero-based it never needs the full range). It probably wants to live on a 2-byte boundary so that it doesn't need to be shifted for each use, unlike the flags.

            I also noticed that brw_page has a __u32 padding at the end, which (by itself) doesn't help, but together with the above changes that would save another 8 bytes from osc_oap_page?

            adilger Andreas Dilger added a comment - I was looking at whether osc_oap_page.oap_cmd could be made smaller, but I see it is already 18 bits in size: #define OBD_BRW_OVER_PRJQUOTA 0x8000 /* Running out of project quota */ #define OBD_BRW_RDMA_ONLY 0x20000 /* RPC contains RDMA-only pages*/ #define OBD_BRW_SYS_RESOURCE 0x40000 /* page has CAP_SYS_RESOURCE */ Both osc_queue_async_io() and osc_page_submit() explicitly (try to) store OBD_BRW_SYS_RESOURCE in oap_cmd (also in oap_brw_flags aka oap_brw_page.flag ), but not much else goes in there ( OBD_BRW_WRITE , OBD_BRW_NOQUOTA ). It doesn't look like oap_cmd is used for anything other than checking OBD_BRW_WRITE , so this could become a single bitfield, or added to oap_async_flags ? Note that modern GCC allows you to use: enum async_flags oap_async_flags:4; to reduce the size, while keeping the consistency checks, though I don't think it makes a difference right now. Shrinking oap_page_off to PAGE_SIZE_BITS won't help by itself either, but gets this down to 12 bits (16 on PPC64/ARM64, since the offset is zero-based it never needs the full range). It probably wants to live on a 2-byte boundary so that it doesn't need to be shifted for each use, unlike the flags. I also noticed that brw_page has a __u32 padding at the end, which (by itself) doesn't help, but together with the above changes that would save another 8 bytes from osc_oap_page ?

            "Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46721
            Subject: LU-15619 osc: Pack osc_async_page better
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 566fd06ae372ed1143f6626f1f71e5d44589ceb0

            gerrit Gerrit Updater added a comment - "Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46721 Subject: LU-15619 osc: Pack osc_async_page better Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 566fd06ae372ed1143f6626f1f71e5d44589ceb0

            "Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46719
            Subject: LU-15619 osc: Remove oap lock
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: f6ed526c415de316b7399bc8a5a8d7aebb9adfdb

            gerrit Gerrit Updater added a comment - "Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46719 Subject: LU-15619 osc: Remove oap lock Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: f6ed526c415de316b7399bc8a5a8d7aebb9adfdb

            "Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46718
            Subject: LU-15619 lov: Remove lov_page slice
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 2b879f4b930259bb2145b22c26155eb359c2aab8

            gerrit Gerrit Updater added a comment - "Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46718 Subject: LU-15619 lov: Remove lov_page slice Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 2b879f4b930259bb2145b22c26155eb359c2aab8

            "Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46717
            Subject: LU-15619 clio: Remove vpg_page pointer
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: e3d4b9e79deb4f20bd941da9c11c94c1dbf3b89a

            gerrit Gerrit Updater added a comment - "Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46717 Subject: LU-15619 clio: Remove vpg_page pointer Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: e3d4b9e79deb4f20bd941da9c11c94c1dbf3b89a

            People

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

              Dates

                Created:
                Updated:
                Resolved: