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
#define OBD_BRW_RDMA_ONLY 0x20000
#define OBD_BRW_SYS_RESOURCE 0x40000
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?
Landed for 2.16