[LU-15619] Reduce size of cl_page and associated structures Created: 04/Mar/22  Updated: 06/Sep/23  Resolved: 06/Sep/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Improvement Priority: Minor
Reporter: Patrick Farrell Assignee: Patrick Farrell
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-10994 remove unused page layers Resolved
Rank (Obsolete): 9223372036854775807

 Description   

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



 Comments   
Comment by Gerrit Updater [ 04/Mar/22 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46712
Subject: LU-15619 osc: Remove submit time
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 019e37365401a034f41cbbdfb89c7a2930ee2890

Comment by Gerrit Updater [ 04/Mar/22 ]

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

Comment by Gerrit Updater [ 04/Mar/22 ]

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

Comment by Gerrit Updater [ 04/Mar/22 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46715
Subject: LU-15619 osc: Rename brw_page members
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1b4fef9bd1827e85229a38cce03c8c3dcc671eeb

Comment by Gerrit Updater [ 04/Mar/22 ]

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

Comment by Gerrit Updater [ 04/Mar/22 ]

"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

Comment by Gerrit Updater [ 04/Mar/22 ]

"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

Comment by Gerrit Updater [ 04/Mar/22 ]

"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

Comment by Gerrit Updater [ 04/Mar/22 ]

"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

Comment by Andreas Dilger [ 26/Aug/22 ]

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?

Comment by Gerrit Updater [ 04/Oct/22 ]

"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

Comment by Gerrit Updater [ 02/Nov/22 ]

"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

Comment by Gerrit Updater [ 22/Nov/22 ]

"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

Comment by Gerrit Updater [ 06/Sep/23 ]

"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

Comment by Peter Jones [ 06/Sep/23 ]

Landed for 2.16

Generated at Sat Feb 10 03:19:52 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.