Could you just mark compound_head __pure? That would tell the compiler that it's safe to re-use the return value as long as there is no memory mutation in between.
- Bloat caused by unnecessary calls to compound_head()? Eric Biggers
- Re: Bloat caused by unnecessary calls to compound_... Kirill A. Shutemov
- [PATCH 1/4] page-flags: generate page-flags he... Kirill A. Shutemov
- [PATCH 4/4] mm: convert make_page_accessed... Kirill A. Shutemov
- [PATCH 3/4] page-flags: make page flag hel... Kirill A. Shutemov
- [PATCH 2/4] mm: introduce struct head_page... Kirill A. Shutemov
- Re: Bloat caused by unnecessary calls to compound_... George Spelvin
- Re: Bloat caused by unnecessary calls to compo... Kirill A. Shutemov