[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: |
|
||||||||
| 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 |
| Comment by Gerrit Updater [ 04/Mar/22 ] |
|
"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46713 |
| Comment by Gerrit Updater [ 04/Mar/22 ] |
|
"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46714 |
| Comment by Gerrit Updater [ 04/Mar/22 ] |
|
"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46715 |
| Comment by Gerrit Updater [ 04/Mar/22 ] |
|
"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46716 |
| Comment by Gerrit Updater [ 04/Mar/22 ] |
|
"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46717 |
| Comment by Gerrit Updater [ 04/Mar/22 ] |
|
"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46718 |
| Comment by Gerrit Updater [ 04/Mar/22 ] |
|
"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46719 |
| Comment by Gerrit Updater [ 04/Mar/22 ] |
|
"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46721 |
| 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 #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/ |
| Comment by Gerrit Updater [ 02/Nov/22 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46719/ |
| Comment by Gerrit Updater [ 22/Nov/22 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46721/ |
| Comment by Gerrit Updater [ 06/Sep/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/46715/ |
| Comment by Peter Jones [ 06/Sep/23 ] |
|
Landed for 2.16 |